【发布时间】:2015-07-22 23:37:38
【问题描述】:
在我的 htaccess 中,我将其设置为重写 URL,因此查询字符串实际上不会显示(漂亮的 url),但似乎如果该站点被放置在子域中,它会显示一个空白页面,副转到正确的页。子域会影响其工作方式还是另一个问题?
RewriteEngine On
RewriteRule ^documents/([^/]+)/?$ documents.php?p=$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
将文件夹/documents.php?p=value 转换为 www.mywebsite.com/folder/documents/VARIABLE(删除 .php?p=value)
子域等价物: subdomain.mywebsite.com/folder/documents/VARIABLE
【问题讨论】:
标签: .htaccess mod-rewrite subdomain