views:

192

answers:

1

I cannot figure out a way to skip the next rule if a .php extension exists in the url

Here is what I'm currently using

RewriteCond %{REQUEST_URI} !\.php
RewriteCond %{REQUEST_URI} \/([0-9a-z]*)$ [NC]
RewriteRule ^(.*) index.php?un=$1 [L]
+1  A: 

Your question is a little ambiguous, but the following may be helpful. It adds a condition to the next rewrite rule, so that it only is evaluated if .php does not occur in the request URI.

RewriteCond %{REQUEST_URI} !\.php
RewriteRule  # Your rewrite rule here
molf
RewriteCond %{REQUEST_URI} !\.phpRewriteCond %{REQUEST_URI} \/([0-9a-z]*)$ [NC]RewriteRule ^(.*) index.php?un=$1 [L]This still causes the php pages to load as a variable
Tim
@Tim, this is a little odd. What URLs are you requesting, and what query string variables are you seeing in your PHP code?
molf
I want domain.com/variable to be used as a variable source, but domain.com/about.php to go to the about.php page.
Tim
The rewrite conditions work fine if I try them. Can you post some additional information that may help figure out what is wrong?
molf