2010-10-07 17 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