I have used this rule in categories:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9-/]+)$ categories.php?url=$1
RewriteRule ^([a-zA-Z0-9-/]+)/$ categories.php?url=$1
I want to hide php extension already for static files like xxx.php. Im using this rule:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php  -f
RewriteRule ^(.*)$ $1.php
This rule not working and xxx.php goes to categories.php page. What rule may I use for static pages? may I use any "folder/(.*)$ $1.php" ?
Should work fine, if you make sure to put the second set of rules first. Remember, the rules are executed in order. So, in the order you have the rules in your post, a request to xxx will be rewritten as categories.php?url=xxx before the second rule ever sees the request... so it never triggers.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论