2010-10-07 49 views

回答

0

現在我知道了答案,這裏是:其中之一是在httpd.conf中使用RewriteRule。 - 塞德里克14秒前編輯 現在我知道了答案,這裏是:其中之一是在httpd.conf中使用RewriteRule。

RewriteEngine On # Turn on the rewriting engine RewriteRule 

RewriteRule ^(.*(\.(html|htm|gif|js|jpg|jpeg|php|css)|\/))$ $1 [L,NC] 
# do not do anything (no rewriting), but don't execute the next rule 
#("NC", tells Apache that this rule should be case-insensitive, and "L" tells Apache not to process any more rules if this one is used.) 

RewriteRule ^.*$ /[NC,R] # rewrite all the other urls to/

這是主要想法。請修改第一個正則表達式以滿足您的需求! (因爲像foo?bar=obu的網址將無法使用,也不會foo/bar

+0

我希望它能幫助某人:) – Cedric 2011-02-09 09:48:56