我正在寻找.htaccess执行以下操作的:
对于访问
mydomain.com的用户,服务器应该index.html从根目录返回文件。对于访问
mydomain.com/something/、mydomain.com/anything/123/、mydomain.com/some%20encoded%20text等的用户,服务器应该index.php从根目录返回文件,并将其后的文本www.mydomain.com/作为 PHP$_GET变量传递。
我尝试了 WordPress .htaccess:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
但这会将所有内容重定向到index.php文件。