2010-03-25 129 views

回答

3

以下是一些示例。

RewriteEngine on 

# www.domain.com/page/example changed to index.php?page=example 
RewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L] 

# www.domain.com/example changed to index.php?v=example 
RewriteRule ^example(/)?$ index.php?v=example [L] 

第二個規則聽起來像是你在追求什麼。

+0

謝謝,我有這樣的事情: 重寫規則^功能(/)$的index.php V =功能[L] 重寫規則^福利(/)$的index.php V =收益[L] ???? RewriteRule^faq(/)?$ index.php?v = faq [L] RewriteRule^pricing(/)?$ index.php?v = pricing [L] RewriteRule^get-started(/)?$ index。 php?v =啓動[L] 如果我在一個主機帳戶上有幾個網站,這是在根目錄? 謝謝! – Coughlin 2010-03-25 21:28:46

+0

對不起,格式化。 – Coughlin 2010-03-25 21:31:30

+0

每個站點都有一個單獨的文件夾還是它們指向同一個文件夾?如果他們指向單獨的文件夾,那麼你將需要每個.htaccess。 – Jonathan 2010-03-25 21:39:02