所以我在我网站的根目录中创建了这个.htaccess:
RewriteEngine On
RewriteRule ^.*admin/.*$ - [L]
RewriteRule ^.*api/.*$ - [L]
RewriteRule ^.*css/.*$ - [L]
RewriteRule ^.*images/.*$ - [L]
RewriteRule ^.*js/.*$ - [L]
RewriteRule ^.*libs/.*$ - [L]
RewriteRule ^.+.php$ - [L]
RewriteRule ^([^/]+)/$ index.php?game=$1 [L]
RewriteRule ^([^/]+)$ /$1/ [R,L]
奇怪的是,在我的个人服务器上它一切正常,但在我的prod服务器上由name.com托管,访问/ admin / path将我引回到网站的/。有什么想法吗?
更新:admin /文件夹中的.htaccess:
AuthType Basic
AuthName "Somename"
AuthUserFile /home/username/.htpasswd