.htaccess -> 域参数 -> https://example.com/page 正在工作而 https://example.com/ 不工作
.htaccess -> Domain parameter -> https://example.com/page is working and https://example.com/ not
我的 .htaccess 文件有问题。我会随时添加一个带有当前域的参数。它确实适用于 https://example.com/page but not for https://example.com/
我当前的 .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?domain=%{HTTP_HOST}&page= [L,QSA]
我已经尝试过使用 .* 和 .在 RewriteRule 而不是 ^(.*)$
使用您显示的示例,只需添加条件以检查您的 Uri,然后使用 index.php 提供它。能否请您尝试以下。请确保在测试您的 URL 之前清除您的浏览器缓存。
RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?domain=%{HTTP_HOST}&page= [L,QSA]
RewriteCond %{REQUEST_URI} ^/?$
RewriteRule ^ /index.php?domain=%{HTTP_HOST} [L]
我的 .htaccess 文件有问题。我会随时添加一个带有当前域的参数。它确实适用于 https://example.com/page but not for https://example.com/
我当前的 .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?domain=%{HTTP_HOST}&page= [L,QSA]
我已经尝试过使用 .* 和 .在 RewriteRule 而不是 ^(.*)$
使用您显示的示例,只需添加条件以检查您的 Uri,然后使用 index.php 提供它。能否请您尝试以下。请确保在测试您的 URL 之前清除您的浏览器缓存。
RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?domain=%{HTTP_HOST}&page= [L,QSA]
RewriteCond %{REQUEST_URI} ^/?$
RewriteRule ^ /index.php?domain=%{HTTP_HOST} [L]