【发布时间】:2013-12-31 21:42:36
【问题描述】:
在我的 php 页面中,我将链接设为 href="test.php?category="xyz"。 在 url 中,我希望此页面链接显示为“test/xyz”。
在我添加的 .htaccess 文件中
RewriteRule ^test/([a-zA-Z]+) test.php?category=$
但这对我不起作用。
test.php 中的所有其他链接都将 test 附加到它们的链接上。 例如。如果有 example.php,它会显示为 test/example.php
感谢您的帮助。 提前致谢
【问题讨论】:
-
发布您的完整 .htaccess 代码。
-
这是我的 .htaccess 文件
RewriteBase 上的 RewriteEngine /mysite RewriteRule ^(.*)\.html $1\.php 选项 +FollowSymLinks RewriteRule ^test/([a-zA -Z]+) test.php?category=$1 ErrorDocument 404 mysite.com/page_not_found.php
标签: php html .htaccess seo rewrite