Forum Moderators: phranque

Message Too Old, No Replies

(Basic) Joining rewrite rule in htaccess

         

basketmen

3:40 pm on Sep 26, 2010 (gmt 0)

10+ Year Member



I have these rewrite rules


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(file1.php)
RewriteCond %{REQUEST_URI} !(file2.php)
RewriteCond %{REQUEST_URI} !(file3.php)

RewriteRule ^/?(af|sq|ar)/([^/]+)/?$ /index.php?z-profile=$2&language=$1 [L,QSA]
#RewriteRule ^/?(af|sq|ar)/([^/]+)/?$ vseo.php?bet_lang=$1&redirected=/index.php?z-profile=$2 [L,QSA]
#RewriteRule ^([^/]+)/?$ index.php?z-profile=$1 [QSA]




i want to joining the rewrite rules in bold above so maybe can make it faster and short, what is looks like, thanks for sharing answer guys

g1smd

7:26 pm on Sep 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



RewriteCond %{REQUEST_URI} !((index|file[1-3])\.php)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d


Note also the revised condition order (for server efficiency), and the inclusion of index.php in the list of exclusions.