[英]URL rewrite rule is not working
我的網址是http://example.com/index.php?pid=software_details&p=18我想將我的網址更改為http://example.com/software_details/18 。 我使用.htaccess文件來執行此操作,但是它無法正常工作...請有人幫我! 提前致謝...!
我的.htaccess代碼如下所示:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/([^/]*)/([^/]*) /index.php?pid=$1&p=$2 [L]
</IfModule>
我認為以下規則應該可以滿足您的需求:
RewriteRule ^/(.*)/(.*)$ /index.php?pid=$1&p=$2 [R=301,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.