|
|
|
|
||||||
| comp.info.servers.unix Web servers for UNIX platforms. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
At the moment my website is visible with the www. prefix and without
(http://www.geoffsoper.co.uk and http://geoffsoper.co.uk), is there any way I can divert people requesting http://geoffsoper.co.uk/anything_at_all to http://www.geoffsoper.co.uk/anything_at_all using directives in ..htaccess files? I have mod_rewrite available to me. Thanks, Geoff |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 2 Mar 2005 14:31:07 -0800,
"Geoff Soper" <geoff.google.nospam@alphaworks.co.uk> posted: > At the moment my website is visible with the www. prefix and without > (http://www.geoffsoper.co.uk and http://geoffsoper.co.uk), is there any > way I can divert people requesting > http://geoffsoper.co.uk/anything_at_all to > http://www.geoffsoper.co.uk/anything_at_all using directives in > .htaccess files? I have mod_rewrite available to me. I've just done the opposite with my website (I have a really short domain name, and wanted to keep it that was so I can print it in tight spaces). This trick (like below) worked for me with removing the www., so I've reversed it to insist on the www. but not tested it. Try this: RewriteEngine On RewriteCond %{HTTP_HOST} ^geoffsoper\.co\.uk$ [NC] RewriteRule ^(.*)$ http://www.geoffsoper.co.uk/$1 [R=301,L] -- If you insist on e-mailing me, use the reply-to address (it's real but temporary). But please reply to the group, like you're supposed to. This message was sent without a virus, please delete some files yourself. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Geoff Soper schrieb:
> At the moment my website is visible with the www. prefix and without > (http://www.geoffsoper.co.uk and http://geoffsoper.co.uk), is there any > way I can divert people requesting > http://geoffsoper.co.uk/anything_at_all to > http://www.geoffsoper.co.uk/anything_at_all using directives in > .htaccess files? I have mod_rewrite available to me. First step: Ask your provider to route http://geoffsoper.co.uk and http://www.geoffsoper.co.uk to the same IP. Second step: Use mod_rewrite: RewriteEngine On RewriteCond %{HTTP_HOST} ^geoffsoper\.co\.uk [NC] RewriteRule ^/(.*) http://www.geoffsoper.co.uk/$1 [R=301,L] B. -- BM Computer-Services, Bergmannstr. 66, 10961 Berlin Webdesign, Internet, Layout und Grafik Tel.: 030/20649400, mobil 0175/7419517, Fax: 030/20649401 Web: http://www.bmservices.de, eMail: kontakt@bmservices.de |
|
![]() |
| Outils de la discussion | |
|
|