English 中文(简体)
.
原标题:.htaccess to vhost

任何人都知道怎么办。 • 为复制(从www.htaccess获取):

RewriteEngine on  
RewriteCond $1 !^(index.php|images|scripts|css|uploads|robots.txt)  
RewriteRule ^(.*)$ /index.php/$1 [L]  

Basically I want all requests except those for /images, /scripts or /css to go through /index.php.

当我使用“htaccess”档案时,它就发挥了作用,但我很想知道,如何通过host子这样做。 conf。 任何人都知道,从业绩、稳定等方面来看,它是否更好地利用对方(vhost.conf vs htaccess)?

问题回答

它应当在以<代码>/为序之前开展工作,或者:

RewriteCond $1 !^(index.php|images|scripts|css|uploads|robots.txt)
RewriteRule ^/(.*)$ /index.php/$1 [L]

或:

RewriteCond $1 !^/(index.php|images|scripts|css|uploads|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

查阅档案的缺点是,这些档案几乎需要根据每一项要求加以解释,而虚拟东道配置只是在服务器启动时才加以解释。

Gumbo++

我在“httpd wiki”上写了这一文章,以涵盖像这个词一样的问题。

http://wiki.apache.org/httpd/RewriteContext





相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签