无法使用 htaccess 从 php 使 seo 友好 URL
Not able to make seo friendly URL from php using htaccess
我在创建 SEO 友好的过程中遇到了问题 url 实际上我有两个 url 重写了一个有效而另一个无效。我不知道为什么?请帮忙
我的url是这个
http://localhost/quotesnew/author.php?authID=1
我希望它成为
http://localhost/author.html
这是我在 .htaccess 文件中的代码
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /quotesnew/index.php?authchar= [L]
RewriteRule ^author\.html$ /quotesnew/author.php?authID=1 [L]
[L]标志停止重写本次循环。因此它永远不会达到第二条规则。
你可以试试
RewriteEngine On
RewriteRule ^author/([^/]*)\.html$ /quotesnew/author.php?authID= [L]
现在你的 url 将是
http://localhost/author/1.html
我在创建 SEO 友好的过程中遇到了问题 url 实际上我有两个 url 重写了一个有效而另一个无效。我不知道为什么?请帮忙 我的url是这个
http://localhost/quotesnew/author.php?authID=1
我希望它成为
http://localhost/author.html
这是我在 .htaccess 文件中的代码
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /quotesnew/index.php?authchar= [L]
RewriteRule ^author\.html$ /quotesnew/author.php?authID=1 [L]
[L]标志停止重写本次循环。因此它永远不会达到第二条规则。
你可以试试
RewriteEngine On
RewriteRule ^author/([^/]*)\.html$ /quotesnew/author.php?authID= [L]
现在你的 url 将是
http://localhost/author/1.html