Article View: demon.tech.unix
Article #367apache & mod_rewrite
From: Ian
Date: Tue, 03 Oct 2000 00:00
Date: Tue, 03 Oct 2000 00:00
37 lines
1498 bytes
1498 bytes
Help,
I've tried to get help regarding this problem in other n/gs, but to no
avail :-(. Hopefully someone here will be able to help....
I'm having real problems trying to get my head round mod_rewrite.
I'm trying to achieve two things;
(1)
my web site can be accessed via several URL's, ie
www.examplesite.co.uk
www.example-site.co.uk
example-site.co.uk
etc..
I want these to be rewritten to one URL - www.examplesite.co.uk
I think I've achieved this by;
RewriteCond %{HTTP_HOST} !www.examplesite.co.uk
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI} [R]
(2)
Now - I wish to have all requests to www.examplesite.co.uk/ go to my
normal document root, but www.examplesite.co.uk/any-other-text (where
'any-other-text', really is any text at all) redirected to
www.examplesite.co.uk/redirect.
Anything I write seems to put a browser in an endless loop, or try to
access www.examplesite.co.uk/any-other-text.
Any advice would be greatly appreciated.
Technical Details
Message-ID:
<39d9d51b.91004647@news.demon.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac57,cf43607257229b22,start X-Google-Attributes: gidfac57,public From: ianl@go-help.com (Ian) Subject: apache & mod_rewrite Date: 2000/10/03 Message-ID: <39d9d51b.91004647@news.demon.co.uk> X-Deja-AN: 677017430 X-NNTP-Posting-Host: mailgate.e-laddin.com:194.70.26.209 X-Trace: news.demon.co.uk 970577202 nnrp-03:5243 NO-IDENT mailgate.e-laddin.com:194.70.26.209 Newsgroups: demon.tech.unix X-Complaints-To: abuse@demon.net