htaccess redirect doesn't work with default .htaccess

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
admsh
Forum Members
Forum Members
Posts: 93
Joined: Tue Aug 19, 2008 6:30 pm

htaccess redirect doesn't work with default .htaccess

Post by admsh »

I'm trying to redirect old html pages to their new locations on the newly-built cmsms website using .htaccess 301 redirect.

I think the code is conflicting with the default syntax from the .htaccess file that was in the docs directory (brand new install of 1.9.4.1)

I'm trying to use this code:

Code: Select all

Redirect 301 /page.htm http://my.site.com/page
But what happens is that when I try to go to http://my.site.com/page.htm, the browser is automatically redirected to http://my.site.com/page?page=page.htm

How can I change the .htaccess code so that these 301 redirects are not affected by the other rewrites?
10010110
Translator
Translator
Posts: 224
Joined: Tue Jan 22, 2008 9:57 am

Re: htaccess redirect doesn't work with default .htaccess

Post by 10010110 »

Yeah, I have the same problem. It would be really great if anybody could shed some light on this. It’s really important because otherwise the new sites have to rebuild their search engine ranking from scratch since basically the whole site has gone and there’s a new one now that has to be reindexed completely.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: htaccess redirect doesn't work with default .htaccess

Post by Rolf »

Try something like:

Code: Select all

RewriteRule page-alias.html$ http://www.cmsmadesimple.org/path/to/page-alias [R=301,L]

RewriteRule ^page-alias$ http://www.cmsmadesimple.org/path/to/page-alias [R=301,L]
Hope this helps,

Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
10010110
Translator
Translator
Posts: 224
Joined: Tue Jan 22, 2008 9:57 am

Re: htaccess redirect doesn't work with default .htaccess

Post by 10010110 »

Yes! I’ve tried the first of your suggestions and it’s working great, thank you! :)
Post Reply

Return to “The Lounge”