【发布时间】:2015-10-06 14:57:41
【问题描述】:
这是我的根文件夹 .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>
这是我的子文件夹 .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 with 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>
我的问题是,当我尝试访问时
http://domain.net/coupon-website/admin
我被重定向到
https://www.domain.net/Admin/index.php
而不是
https://www.domain.net/coupon-website/Admin/index.php
我错过了什么?为什么我被重定向到根文件夹而不是优惠券网站子文件夹?
【问题讨论】:
标签: php apache .htaccess mod-rewrite redirect