更改URL以的.htaccess [英] change url with .htaccess
本文介绍了更改URL以的.htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下格式的URL:
I have an url in the following format:
http://example.com/realestate/index.php?page=services.html
它如何改变与以下格式的的.htaccess
文件?
http://example.com/services.html
让的index.php?网页=
被省略,只 services.html
部分显示在浏览器的
网址。
So that index.php?page=
is omitted and only services.html
part is shown in the browser's
url.
我不知道写.htaccess文件什么。
I dont know anything about writing .htaccess files.
推荐答案
尝试是这样的:
RewriteEngine on
RewriteRule (.*)\.html http://example.com/index.php?page=$1 [L]
现在的URL xyz.com/services.html将被改写为xyz.com/index.php?page=services.html~~V
Now the url xyz.com/services.html would be rewritten to xyz.com/index.php?page=services.html
这篇关于更改URL以的.htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文