httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From D.Oba...@ehapa.de
Subject AW: mod_rewrite
Date Tue, 06 Aug 2002 09:27:44 GMT
hy,

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} !^http://www.yps.de/.*$ [NC]	# or
everybody with a referrer that does not start with http://www.yps.de...
RewriteRule ^/$ /index.html [r] # should be redirected from subpages to the
startpage


Greetings,
David

> 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. 
> http://httpd.apache.org/docs/mod/mod_rewrite.html#RewriteCond
> 
> then see
> http://httpd.apache.org/docs/misc/rewriteguide.html
> for examples that test for missing files and redirect accordingly.
> 
> Michael
> 
> -----Original Message-----
> From: D.Obando@ehapa.de [mailto:D.Obando@ehapa.de]
> Sent: Tuesday, 6 August 2002 9:02 a.m.
> To: users@httpd.apache.org
> 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 
> xyz.org/example/example.html, s/he should be redirected to 
> xyz.org/index.html. If the user already surfs on the site 
> (referrer xyz.org//*), 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 (xyz.org/index.html), 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: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message