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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Rewrite old files


Go to End


3 Posts   997 Views

Avatar
suntrop

Community Member, 141 Posts

5 July 2010 at 10:04pm

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
bummzack

Community Member, 904 Posts

5 July 2010 at 11:17pm

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

Community Member, 141 Posts

6 July 2010 at 7:20pm

I ought to have known better :)

Thanks, banal. Works fine with the L flag now