Following code works great. However It takes so much time to do it for hundreds of php files;
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/abc.php
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} !^/home.php
RewriteCond %{REQUEST_URI} !^/settings.php
RewriteCond %{REQUEST_URI} !^/messages.php
...
...
...
RewriteRule ^/?([a-zA-Z0-9\-=&_@/.]+)/?$ abc.php?u=$1 [QSA,L]
Yes, you can use:
RewriteEngine on
RewriteBase /
# The request is not for a valid file/directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/?$ abc.php?u=$1 [L,QSA]
If you want to exclude only PHP files, you can use:
RewriteCond %{REQUEST_URI} !\.php$ [NC]
RewriteRule ^(.+?)/?$ abc.php?u=$1 [L,QSA]