I have rewrite rule in parent directory which rewrites URL:
- From
example.com/index.php?id=test&cat=category
- To
example.com/index?test&cat=category
Here is my .htaccess file:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{QUERY_STRING} ^(\w+)?((&(\w+)=(\w+))+)?$ [NC]
RewriteRule ^/?(\w+)$ $1.php?id=%1%2 [NC,L]
But when URL is example.com/directory/file
this rule doesn't work in child directory.
What can I do to make it work in other child directories?