httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject AW: mod_rewrite
Date Tue, 06 Aug 2002 09:27:44 GMT

well I don't need an rewriteCond for missing files, but want to redirect
users with external referrers from subpages to the homepage.

I wrote a rule, but it does not work, something's wrong with it:

RewriteEngine  on
RewriteCond %{HTTP_REFERER} - [OR,NC]	#everybody with no referrer...
RewriteCond %{HTTP_REFERER} !^*$ [NC]	# or
everybody with a referrer that does not start with
RewriteRule ^/$ /index.html [r] # should be redirected from subpages to the


> The rewriteCond directive has some tests for the existence of 
> a file or directory (-d and -f) that you may be able to use 
> to redirect if a file or path doesn't exist. 
> then see
> for examples that test for missing files and redirect accordingly.
> Michael
> -----Original Message-----
> From: []
> Sent: Tuesday, 6 August 2002 9:02 a.m.
> To:
> Subject: mod_rewrite
> Hello, 
> I got a question about the use of mod_rewrite. 
> I want to install a rewrite-rule, doing the following: 
> If a user requests (with an external referrer) the URL 
>, s/he should be redirected to 
> If the user already surfs on the site 
> (referrer*), than this rule should not redirect the user.
> Background: 
> I have an archived website and I want Users, who enter the 
> site via deeplink, a search engine, ... on a subpage, to be 
> redirected to the homepage (, where'll be 
> an explanation, that it is archived. After that redirect the 
> user should be able to surf along as s/he likes to. Does 
> anybody have a clue how to build such a rule? 
> Thanks in advance, 
> David 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message