我在技术上有两个子目录。 / products / industry /
我想重定向如下:
/products/industry to /products/#industry
但是我不想重定向类似的内容:
/products/industry/product-name
或任何可能跟随/行业的事情。这是我在我的htaccess中没有工作的东西。也许我很亲密?
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/products/industry[/]?$
RewriteRule (.*) /products/#industry [R=301,L]
答案 0 :(得分:0)
你可以这样做:
RewriteEngine On
RewriteBase /bti/
RewriteRule ^(products)/(industry)$ $1/#$2 [R=301,L,NE,NC]