php - Subfolder .htaccess redirecting to root folder -
here's root folders .htaccess
options +followsymlinks options -indexes <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{server_port} 80 rewriterule ^(.*)$ https://www.domain.net/$1 [r=301,l] rewritecond %{http_host} !^www\. rewriterule ^(.*)$ https://www.domain.net/$1 [r=301,l] </ifmodule>
here's subfolder .htaccess
<ifmodule mod_rewrite.c> rewritecond %{request_uri} /admin/?$ rewriterule ^(.*)$ %1/admin/index.php [ne,r,l] rewritecond %{request_uri} /admin/?$ rewriterule ^(.*)$ %1/admin/index.php [ne,r,l] rewritecond %{request_uri} /stores/?$ rewriterule ^(.*)$ %1/stores/ [ne,r,l] rewritecond %{request_uri} /categories/?$ rewriterule ^(.*)$ %1/categories/ [ne,r,l] # working client side rewritecond %{request_filename} !-f rewriterule ^([^/]*)$ index.php?qstr=$1 [qsa,l] rewriterule ^coupons/(.*)$ index.php?qstr=coupons/$1 [qsa,l] rewriterule ^(.*)/$ index.php?qstr=$1 [qsa,l] </ifmodule>
my problem is, when try access
http://domain.net/coupon-website/admin
i'm redirected
https://www.domain.net/admin/index.php
instead of
https://www.domain.net/coupon-website/admin/index.php
what did miss? why redirected root folder instead of coupon-website subfolder?
after trial , error, found solution. here's new subfolder .htaccess , working expected.
<ifmodule mod_rewrite.c> rewritecond %{request_uri} /admin/?$ rewriterule ^(.*)$ %1/coupon-website/admin/index.php [ne,r,l] rewritecond %{request_uri} /admin/?$ rewriterule ^(.*)$ %1/coupon-website/admin/index.php [ne,r,l] rewritecond %{request_uri} /stores/?$ rewriterule ^(.*)$ %1/coupon-website/stores/ [ne,r,l] rewritecond %{request_uri} /categories/?$ rewriterule ^(.*)$ %1/coupon-website/categories/ [ne,r,l] # working client side rewritecond %{request_filename} !-f rewriterule ^([^/]*)$ index.php?qstr=$1 [qsa,l] rewriterule ^coupons/(.*)$ index.php?qstr=coupons/$1 [qsa,l] rewriterule ^(.*)/$ index.php?qstr=$1 [qsa,l] </ifmodule>
Comments
Post a Comment