2012-04-23 42 views
1

我在.htaccess哈瓦一個有些問題..PHP htaccess的問題重定向

我的網站的網址是前。 www.example.com/

,當我們去到城市頁面使用dropdown..its來index.php?city=cityname(它是正確的)

,當我們去公司簡介頁面說到做到indexpage,而不是關於我們頁面

城市頁面網址:www.example.com/cityname

關於我們網址:www.example.com/about-us

下面的htaccess代碼;

,當我們去了解我們的頁面談到索引頁

RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?city=$1 
RewriteRule ^about-us$ about_us.php 
+0

爲了幫助澄清,告訴我們究竟是預期的行爲,以及究竟正在發生的事情吧。謝謝。 – 2012-04-23 04:45:48

回答

0

你需要只是改變重寫的順序。所以,使用此:

RewriteRule ^about-us$ about_us.php 
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?city=$1 
+0

非常感謝.. – Viju 2012-04-23 05:44:09

+0

@Viju請選擇上面的答案,如果它有幫助。這個問題仍然列在未解答的問題下。 – hjpotter92 2015-09-29 18:44:48