digitaleditor — 2012-06-01T17:17:10-04:00 — #1
I am switching CMS platforms and trying to create 301 redirects in htaccess.
This is what I have written but it will not redirect it just displays 404 error page.
RewriteRule ^/category/merchants/123inkjets/?$ stores/123inkjets/ [R=301,NC,L]
What am I doing wrong?
scallioxtx — 2012-06-01T17:21:45-04:00 — #2
Assuming this is Apache 2 (since 1 is almost not used anymore),you need to drop the leading slash:
RewriteRule ^category/merchants/123inkjets/?$ stores/123inkjets/ [R=301,NC,L]
I assume you have RewriteEngine On in your .htaccess too somewhere above that RewriteRule?
Also, since this is pretty simple redirect, I'd use mod_alias instead of mod_rewrite. Simply
Redirect 301 /category/merchants/123inkjets http://yourdomain.com/stores/123inkjets/
digitaleditor — 2012-06-01T17:41:10-04:00 — #3
Awesome. Thanks! Works perfectly.