[英].htaccess file is not working
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|gallary|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
上面是.htaccess中存在的代碼。
我希望諸如對主域或子域的每個請求之類的規則必須命中域根目錄中的index,php文件。
EXM。 api.xyz.com,api.xyz.com / register,api.xyz.com / login所有此請求都必須轉到index.php
我在ipage網站主機上遇到此錯誤。 如果主機也有問題,請提出建議。
嘗試以下規則:
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php/$1 [L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.