2012-02-13 122 views
0

我有以下格式的URL:變化網址的.htaccess

http://example.com/realestate/index.php?page=services.html 

如何與一個.htaccess文件,將其更改爲以下格式?

http://example.com/services.html 

這樣index.php?page=省略,只services.html部分在瀏覽器的URL 所示。

我不知道寫關於.htaccess文件的任何信息。

+0

複製的[如何我可以使用.htaccess更改網址嗎?](http://stackoverflow.com/q/4564338/1124792)。 – perelman 2012-02-13 06:58:11

回答

1

嘗試這樣:

RewriteEngine on 
RewriteRule (.*)\.html http://example.com/index.php?page=$1 [L] 

現在的URL xyz.com/services.html將被改寫爲xyz.com/index.php?page=services.html