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.

Migrating a Site to Silverstripe /

What you need to know when migrating your existing site to SilverStripe.

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

301 redirect


Go to End


2 Posts   3356 Views

Avatar
cmcm

Community Member, 2 Posts

19 December 2009 at 4:46am

Hi,
I am replacing a static site with a silverstripe one.
I have a static url http://www.mysite.com/products/product-one.html and the silverstripe page for this url is http://www.mysite.com/product-one/

the file structure on the backend of the silverstripe cms is /products/product-one/

I have tried a 2 redirect methods:

This: RewriteRule ^products/product-one.html product-one [R=301,NC,L]
and
This: Redirect /products/product-one.html http://www.mysite.com/product-one/

When I enter the static url in the browser it redirects to http://www.mysite.com/products/product-one/ which cause all sort of page layout errors, why can't it redirect to http://www.mysite.com/product-one/ ?

Help anyone?

Thanks.

Avatar
scpi

Community Member, 21 Posts

26 February 2010 at 5:26am

Your first attempt ought to do it, you just need to make sure that line immediately follows the RewriteBase line.

e.g.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^products/product-one.html product-one [R=301,NC,L] 

Unless you tried that already...