Afficher un message
Vieux 18/03/2005, 09h25   #2
Tim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Possible to use wildcard in.htaccess?

licheng <lichengNoSpam@pchome.com.tw> posted:

> In .htaccess, we can use
>
> SetEnvIfNoCase Referer "^http://mywebsite\.com/" local_ref=1
>
> But how can we specify *.mywebsite.com? For example,
>
> content.mywebsite.com
> web.mywebsite.com
> pub.mywebsite.com
> company.mywebsite.com


The dot is a wildcard in regex expressions, itself. You don't need the
asterisk for that sort of thing.

> It seems that
>
> SetEnvIfNoCase Referer "^http://*\.mywebsite\.com/" local_ref=1
>
> or
>
> SetEnvIfNoCase Referer "^http://\*\.mywebsite\.com/" local_ref=1
>
> doesn't work.


That's because the backslash in front of the dot escapes it so that it's
only treated as a dot rather than a wildcard, and you've started the
pattern matching before it.

Try: SetEnvIfNoCase Referer ".mywebsite\.com/" local_ref=1

NB: That's an untested example, but it means to match with a referrer in
this sort of fashion *mywebsite.com* (i.e. doesn't care what it starts with
or ends with, as long as that's in there somewhere).

--
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.
  Réponse avec citation
 
Page generated in 0,05749 seconds with 9 queries