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.

Archive

Our old forums are still available as a read-only archive.

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

301 redirects


Reply

4 Posts   1890 Views

Avatar
superautomatic

15 October 2008 at 10:53pm (Last edited: 15 October 2008 10:54pm), Community Member, 53 Posts

Hi,

How do I take care of permanent page-redirects after converting an old static site to a silverstripe site? I want to redirect the old pages to the silverstripe counterparts. That is, on the old site I had a page with the url:
http://www.pathfindertravels.se/pages/pathvand/marockov1.html

which on the new site correspondes to:
http://www.pathfindertravels.se/vandring-i-atlasbergen-marocko/

Normally I would just add rows in .htaccess to handle this, like:
redirect 301 /pages/pathvand/marockov1.html http://www.pathfindertravels.se/vandring-i-atlasbergen-marocko/

But this doesn't work. (Well it partly works, since the new rewritten url is http://www.pathfindertravels.se/vandring-i-atlasbergen-marocko/?url=/pages/pathvand/marockov1.html)

Should I be using Director::redirectPerm instead? And if so, how do I do that? Other ideas?

Thanks in advance,

/Jens

Avatar
superautomatic

16 October 2008 at 12:24am (Last edited: 16 October 2008 12:24am), Community Member, 53 Posts

Found a discussion about this in an [url=http://www.silverstripe.com/site-builders-forum/flat/48074]old thread[/url], sorry. But following the advices in that thread, I still can't get it to work.

If I use the suggested RewriteRule, nothing happens. And if I use the redirect, the URI is rewritten, but I still get the old one attached at the end, with "?url=old_url".

Any other suggestions?

/Jens

Avatar
superautomatic

16 October 2008 at 4:11am (Last edited: 30 October 2008 8:09am), Community Member, 53 Posts

Ok, I must have mixed a few things up. Anyway, this works for me now:

RewriteRule pages/english.html http://www.pathfindertravels.se/welcome-to-the-world-of-pathfinder-travels/ [R=301,L]

Case closed I guess.

/Jens

Avatar
Rube_25

17 October 2008 at 11:59am Community Member, 36 Posts

hi

I did file in the htaccess redirects

I feel sorry for my bad English.