【发布时间】:2021-09-13 14:25:24
【问题描述】:
如何在稍后在线托管的 localhost 上执行以下操作:
我有这个链接:
http://localhost/shops/shop.php?c=15
我想改写成http://localhost/shops/shop/15
htaccess是(放在C:\wamp\www\shops folder):
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?RECIPES/(.*?)/?$ /single-product-details.php?=$1 [L]
RewriteRule ^/?SHOP/(.*?)/?$ /shop.php?=$1 [L]
【问题讨论】:
-
请在您的问题中分享您尝试过的 htaccess 规则文件,谢谢。
-
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/?RECIPES/(.*?)/?$ /single-product-details.php?= $1 [L] RewriteRule ^/?SHOP/(.*?)/?$ /shop.php?=$1 [L]
标签: .htaccess redirect mod-rewrite url-rewriting friendly-url