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.

Archive /

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

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

301 redirects


Go to End


4 Posts   2415 Views

Avatar
superautomatic

Community Member, 53 Posts

15 October 2008 at 10:53pm

Edited: 15/10/2008 10:54pm

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

Community Member, 53 Posts

16 October 2008 at 12:24am

Edited: 16/10/2008 12:24am

Found a discussion about this in an old thread, 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

Community Member, 53 Posts

16 October 2008 at 4:11am

Edited: 30/10/2008 8:09am

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

Community Member, 36 Posts

17 October 2008 at 11:59am

hi

I did file in the htaccess redirects

I feel sorry for my bad English.