我正在尝试使用 htaccess php 创建 SEO 友好的 URL。
这是原始网址:
http://www.example.in/viewitem.php?typedp=bus&viewdp=bus-seat-test-item
预期的 SEO 友好 URL:
http://www.example.in/bus/bus-seat-test-item
在 .htaccess 中使用以下规则
Options +FollowSymLinks
RewriteEngine on
RewriteRule typedp/(.*)/viewdp/(.*)/ viewitem.php?typedp=$1&viewdp=$2
但它显示为未找到 404 错误。
我对这个概念很陌生。
感谢任何帮助。
最佳答案
试试这个:
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /viewitem.php?typedp=$1&viewdp=$2 [QSA, L]
关于apache - .htaccess seo 友好 url 未找到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41084905/