Welcome, Guest. Please login or register.
Did you miss your activation email?
15 Mar 2010, 01:07

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: [1]
Print
Author Topic: How to 301 redirect w/ mod_rewrite enabled  (Read 1017 times)
0 Members and 1 Guest are viewing this topic.
curlypinky
Forum Members
**

Karma: 0
Offline Offline

Posts: 26


« on: 15 Jun 2009, 23:19 »

I've just recently redesigned an old static site to cmsms and needed to redirect the old pages. I found that using redirect 301 was producing urls that take you to the new page but then append ?page=oldpage.html which caused it to have a 401 error. Hunting around the forum I found that you need to use RewriteRule instead but it took me awhile to find the info then construct the string correct. Hopefully this will help out others needing to know how to build 301 redirects when mod_rewrite is enabled for pretty urls.


use RewriteRule instead of redirect 301 and place the code directly under
Code:
RewriteBase /

Your redirect command should look like this:
Code:
RewriteRule ^oldpage.html$ http://www.yoursite.com/newpage.html [R=301,L]

-Alane
Logged
Pierre M.
Support Team member
Support Guru
Power Poster
****

Karma: 32
Offline Offline

Posts: 3736

Location: Paris

Please keep it simple


« Reply #1 on: 17 Jun 2009, 10:34 »

See also http://wiki.cmsmadesimple.org/index.php/How_to#How_to_motorize_your_old_plain_html_static_site_with_CMS_Made_Simple
Logged

-- Pierre, support team member. comodrateur du forum francophone.
Please read "how to submit installation/support requests" before posting. Don't send private messages to ask for support.
Want to contribute to CMSms ? Improve the wiki with your forum account.
Pages: [1]
Print
Jump to: