Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Rewrite old files


Reply

3 Posts   694 Views

Avatar
suntrop

5 July 2010 at 10:04pm Community Member, 131 Posts

Hi all.
I launched the first two sites I made with SS last week. As on every relaunch I put some rewrites in the .htaccess file but SS rewrites them again hence they never get to my url.

Redirect permanent /development.php http://www.example.com/online/development/

URL http://www.example.com/development.php => http://www.example.com/online/development/?url=development.php

I tried RewriteRule (.*)development\.php http://www.example.com/online/development/ [NC,R=301] as well but that results in an error 400.

Does anybody know how to rewrite my old files? Unfortunately redirect pages in SS are not helpful, because I can't type in development.php :(

Hope someone can help

Avatar
banal

5 July 2010 at 11:17pm Community Member, 901 Posts

You should add the "L" flag (last) to your RewriteRule, eg. [R=301,NC,L] since that will prevent the execution of further rewrites if a match was found.

Avatar
suntrop

6 July 2010 at 7:20pm Community Member, 131 Posts

I ought to have known better :)

Thanks, banal. Works fine with the L flag now