重写一个链接的漂亮网址

时间:2015-08-15 08:23:08

标签: .htaccess url-rewriting

我需要帮助,我有 http://website.com/index.php?catg=code&subcatg=code_name 这样的链接,当我点击此链接时,它会在地址栏中显示此网址,鼠标任务栏中显示相同的网址结束了。

我试过了,

RewriteEngine On

RewriteRule ^index/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/?$ http://website.com/index.php?catg=$1&subcatg=$2 [NC,L,QSA]

但它没有奏效。  是否可以将此网址重写为 http://website.com/index/code/code-name ??? 并且它必须在地址和地址中看起来很漂亮任务栏。

请帮助
感谢

1 个答案:

答案 0 :(得分:1)

看起来这可能就是你要找的东西:

URL rewriting that visibly rewrites (changes the URL in the address bar)

您可能只需要添加“R”标志。