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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

htaccess rewrite


Go to End


2 Posts   612 Views

Avatar
lozhowlett

Community Member, 151 Posts

4 May 2012 at 8:39pm

Hi everyone

I have a site that was a .aspx site we have merged over to SS

I have a rewrite rule in place...

RewriteRule ^resortdetails.aspx?ResortCode=2068 inspireme [R=301,NC,L]

But it doesnt work, any ideas?

This works fine...
RewriteRule ^resortdetails.aspx inspireme [R=301,NC,L]
... but i need to it handle different IDs to point to different sections of the site.

Thanks in advance!

Avatar
swaiba

Forum Moderator, 1899 Posts

4 May 2012 at 9:26pm

You're in luck - I had to do the exact thing last week... one of these for each...

RewriteCond %{REQUEST_URI} ^/resortdetails\.aspx$
RewriteCond %{QUERY_STRING} ^ResortCode=2068$
RewriteRule ^(.*)$ http://www.somefulldomain.com/inspireme [R=301,L]

If you can tell me how to redirect to a "clean" URL without still passing the params then I'd love to hear back