Re: Not found regex

From: Date: Mon, 04 Aug 2008 19:21:31 +0000
Subject: Re: Not found regex
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-277682@lists.php.net to get a copy of this message
Boyd, Todd M. wrote:
-----Original Message----- From: Shawn McKenzie [mailto:nospam@mckenzies.net] Sent: Monday, August 04, 2008 10:33 AM To: php-general@lists.php.net Subject: Re: [PHP] Not found regex Manoj Singh wrote:
Hi All, Thanks for your replies. Actually i am placing this regex in .htaccess file. Here i have to redirect all the request to https if it is not for
ogg
file.
The complete code is: RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} ^.+\.ogg$ //Need some tweaking here. I
know this
code works just opposite. Need your help here. RewriteRule .* https://%{HTTP_HOST}/ [L] Hope this helps to understand the problem. Best Regards Manoj Singh
It will be part of the condition syntax not the regex: RewriteCond %{REQUEST_URI} !^.+\.ogg$ Maybe better as (not tested): RewriteCond %{REQUEST_URI} !^[^\.]*\.ogg$
I'm pretty sure that a "." inside of a character set (the square brackets []) doesn't need to be slashed. You're looking for "not a backslash or a period" in that character set. And btw... if you don't need to have the entire pathname returned (but only whether or not it matches your condition), then you can trim the fat off your regex and just use: !\.ogg$ Todd Boyd Web Programmer Yes, the important part being !
-Shawn

« previous php.general (#277682) next »