[Wylug-help] Fwd: Re: Apache .htaccess file.
John Craven
jc at ukzone.com
Sun Oct 18 23:38:25 UTC 2009
>Hi Doug...
Hope I didn't confuse you.
I DID use the rewrite rule but I DON'T now.
So if you checked my site, you would get what you asked for.
i.e. www.countrymusic.org.uk or countrymusic.org.uk
However, I have been doing some experimenting to test your requirements and this code works for me:
# redirect any URLs that don't have "www."
RewriteCond %{HTTP_HOST} !^www\.countrymusic\.org\.uk [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/?(.*) http://www.countrymusic.org.uk/$1 [L,R,NE]
You can test it with http://countrymusic.org.uk
hth
John C
>Hi all, Thanks for your replies John and Smylers. I have altered my
>htaccess file as below, but it still isn't doing as I want.
>
>Looking at johns website, www remains at the front, so I don't think I
>would need to change the rewrite cond and rule around. Do I need to
>omit the /www in the first rewrite cond rule? so it points all
>http://d(etc).co.uk to http://www.d(etc).co.uk?
>
>Cheers
>
>Doug
>
><IfModule mod_ssl.c>
> RewriteBase /d******.co.uk/
></IfModule>
><IfModule !mod_ssl.c>
> RewriteBase /
></IfModule>
> RewriteEngine On
> # And for a site running on port 80
> RewriteCond %{HTTP_HOST} !^www\.d******\.co.uk [NC]
> RewriteCond %{HTTP_HOST} !^$
> RewriteRule ^/(.*) http://www.d******.co.uk/$1 [L,R]
> RewriteRule ^([^.]*)$ index.cgi/$1 [L,NE]
>RewriteEngine On
>
>
>_______________________________________________
>Wylug-help mailing list
>Wylug-help at wylug.org.uk
>https://mailman.lug.org.uk/mailman/listinfo/wylug-help
=================================================
Check out our British Country Music Web Sites
http://www.countrymusic.org.uk
http://www.bcmi-radio.co.uk
Over 300,000 visitors a week
=================================================
More information about the Wylug-help
mailing list