Changing URL segment using mod_rewrite

182 views Asked by At

I had to move a very old expressionengine (v1.7) website to a new host and this required some changes to my url structure. Because the site has been around a while, people are sure to have bookmarked the old urls which have changed. Not for lack of trying, I'm having difficulty getting my .htaccess file to properly redirect urls to the new format.

I had urls like http://example.com/cre/teachers/... and http://example.com/cre/reseachers/... and now I need to change them to http://example.com/index.php/teachers/... and http://example.com/index.php/researchers/...

Here's one thing I tried that didn't work

RewriteCond %{REQUEST_URI} "/cre/"
RewriteRule "(.*)/cre/(.*)" "$1/index.php/$2" [PT]

This, while better as it sent people to my homepage, also didn't work

RewriteRule   ^cre/(.+)$  index.php/$1

What am I missing?

0

There are 0 answers