简体   繁体   English

用.htacess重写url不起作用

[英]Rewrite url with .htacess doesnt work

I have a link 我有一个链接

http://www.mydomain.com/place/index.php?slug=antalya-hotels http://www.mydomain.com/place/index.php?slug=antalya-hotels

and i want to write this like 我想这样写

http://www.mydomain.com/place/antalya-hotels.html http://www.mydomain.com/place/antalya-hotels.html

I have tried this 我已经试过了

    RewriteEngine On
RewriteRule ^([^/]*)\.html$ /place/index.php?slug=$1 [L]

Bu didnt work. 卜没有工作。 how we can do. 我们该怎么做。

You can use: 您可以使用:

RewriteEngine On
RewriteRule ^place/([^.]+)\.html$ /place/index.php?slug=$1 [L,QSA,NC]

OR 要么

RewriteRule ^([^/]+)/([^.]+)\.html$ /$1/index.php?slug=$2 [L,QSA,NC]

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

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