Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite working on local but not online

         

perfilbajo

6:14 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



nedd help for that, getting crazy

RewriteCond %{HTTP_HOST}!^www.mysite.com$
RewriteRule ^(.*)$ [mysite.com...] [R=301,L]

this rule is working ok on my local apache, but it doesn't on the server.

I try to redirect all non www URL to www URL, also subdomains.

perfilbajo

6:15 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



sorry, forgot this:

server: Apache/2.0.53
local: Apache/1.3.27 (local) EasyPhp

encyclo

6:20 pm on Jan 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums perfilbajo. When you say it "doesn't work", do you mean that it has no effect, or that it gives a 500 server error or other? Have you any other rules? Have you tried adding the lines:

RewriteEngine On
RewriteBase /

extras

7:16 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



Once the basic problem solved, you may want to see this, as he is asking the same thing.
[webmasterworld.com...]

perfilbajo

8:17 am on Jan 25, 2006 (gmt 0)

10+ Year Member



I mean it has no effect. In fact it does work on the basic url

mydomain.com is correctly redirected to www.mydomain.com but no individual pages as mydomain.com/page1 or mydomain.com/page2 etc.

Span

11:27 am on Jan 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There shouldn't be an end-anchor in your condition:

RewriteCond %{HTTP_HOST} !^www.mysite.com$


RewriteCond %{HTTP_HOST} !^www\.mysite\.com [NC]