Tell me more ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.