【发布时间】:2013-12-10 19:15:53
【问题描述】:
我正在处理的 WordPress 网站有一个独特的问题。我的客户想要一个让人们获得“自定义”或“虚荣”网址的促销活动,但所有网址都只是转到同一个 WordPress 页面。
启用 WordPress 漂亮网址后,需要在地址栏中显示的网址如下所示:
example.com/subpage/username
但是,它只会提供此页面:
example.com/subpage/
最接近的解决方案I found 建议我在下面的 .htaccess 代码中添加类似于第 6 行的内容。这以重定向到 example.com/subpage/ 的方式起作用,但不会将用户名保留在 url 中。我被困在如何做到这一点上。这是我现在的 .htaccess 代码。
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^survey/. /index.php?p=370 [L,QSA]
RewriteRule . /index.php [L]
【问题讨论】:
标签: wordpress apache .htaccess mod-rewrite subdirectory