我有一个url像
http://www.mywebsite.com/shop-single-full.php?img=35
我想重写并重定向这个url,像
http://www.mywebsite.com/Pure-Copper-Embossed-Jug-amp-4-Steel-Copper-Glass-Set-35.html
,其中文本为产品名称。我还想当有人想访问
时http://www.mywebsite.com/shop-single-full.php?img=35
它会自动重定向到
http://www.mywebsite.com/Pure-Copper-Embossed-Jug-amp-4-Steel-Copper-Glass-Set-35.html
无论我做了什么都是
RewriteRule ^shop-single-full/?$ ([A-Za-z0-9_'-]+)'-([0-9]+).html?%1 [R,L]
RewriteRule ^([A-Za-z0-9_'-]+)'-([0-9]+).html?$ /shop-single-full.php?img=$2&name=$1
但是在重定向中有一些问题。由于
在shop-single-full.php
中使用header()
header("Location: http://www.mywebsite.com/Pure-Copper-Embossed-Jug-amp-4-Steel-Copper-Glass-Set-35.html");
点击这里阅读更多关于header()
的信息