php - .htaccess Issue : 404 for index -
this .htaccess
file in sub-folder
...
<ifmodule mod_rewrite.c> rewriteengine on rewriterule ^index\.php$ - [l] rewriterule (.*) ./index.php?id=$1 [l] </ifmodule>
i want mydomain.com/sub-folder/string
processed index.php mydomain.com/sub-folder/?id=string
but getting 404... not sure why. root .htaccess
# begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress
keep root .htaccess as:
# begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^(index\.php|sub-folder(/.*)?)$ - [l,nc] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . index.php [l] </ifmodule> # end wordpress
and keep in /sub-folder/.htaccess
:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase /sub-folder/ rewriterule ^index\.php$ - [l,nc] rewriterule (.+) index.php?id=$1 [l,qsa] </ifmodule>
Comments
Post a Comment