2015-07-17 2 views
2

Вот мои корневые папки .htaccessSubfolder .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 

Что я пропустил? Почему я перенаправлен в корневую папку вместо подпапки купона?

ответ

0

После проб и ошибок я наконец нашел решение. Вот моя новая подпапка .htaccess и теперь работает как ожидалось.

<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 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> 
Смежные вопросы