繁体   English   中英

htaccess的简短URL

[英]Short URL with htaccess

因此,我想在网络浏览器中明确网址/短网址。 我已经阅读了很多htaccess教程... modrewrite等。首先,我在localhost(Xampp)中尝试过,但是不起作用...

这是我要更改的链接:

localhost/proj/index.php?menulinks=contents/products

我想在这里更改链接: index/contents/products或任何类型的解决方案这是htaccess:

RewriteRule ^index.php$ - [L]
RewriteRule ^(.+)/?$ index.php?menulinks=$1 [L]

没用

将以下内容添加到htaccess中应该可以实现所需的功能。

RewriteEngine On
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /proj/index\.php\?menulinks=(.*)\ HTTP
RewriteRule ^ /index/%2\? [R,L]

RewriteRule ^index/(.*)$ /proj/index.php?menulinks=$1 [L]

proj/index.php?menulinks=contents/products转换为index/contents/products

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM