Mod_rewrite ile Yardım

1 Cevap php

I have folder home/admin. In this folder there is index.php. When i access to domain.com/admin/ my mod_rewrite rule redirects it my index.php in the home folder. I want mod_rewrite to skip existing folder or files, and special case for /admin/ folder, which contains index.php file.

Benim yeniden yazma kuralı:

 <IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteRule ^$ index.html [QSA]
   RewriteRule ^([^.]+)$ $1.html [QSA]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^(.*)$ index.php [QSA,L]
 </IfModule>

Teşekkürler.

1 Cevap

Değiştirmeyi deneyin

RewriteCond %{REQUEST_FILENAME} !-f

karşı

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

This will skip direckarşıries as well as files

Edit: I think it's this rule that's going wrong (as well):

RewriteRule ^([^.]+)$ $1.html [QSA]

Bunun yerine bu deneyin

RewriteRule (^|/)([^.]+)$ $2.html [QSA]