我有一个像
的网址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
其中text是产品名称。 当有人想要访问
时我也想要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
但重定向存在一些问题。谢谢
答案 0 :(得分:0)
在header()
shop-single-full.php
header("Location: http://www.mywebsite.com/Pure-Copper-Embossed-Jug-amp-4-Steel-Copper-Glass-Set-35.html");
详细了解header()
here