2013-03-19 35 views
0

我想阿帕奇重寫:如果不存在/公共開放作爲/public/index.php/

  1. http://kemtime2_neu.pr.domain.de/css/style.css打開爲http://kemtime2_neu.pr.domain.de/public/css/style.css
  2. http://kemtime2_neu.pr.domain.de/loginhttp://kemtime2_neu.pr.domain.de/public/index.php/login

我打開有

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /public/index.php/$1 [L] 

這適用於2.

如何讓它爲1工作?請注意,我無法更改文檔根目錄(對不起!)。

回答

0

發現:

# Redirect to static content 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond /var/www/de/domain/pr/kemtime2_neu/public%{REQUEST_URI} -f 
RewriteRule ^(.+)$ /public/$1 [L] 

# otherwise redirect to script 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /public/index.php/$1 [L] 
0

將您的DocumentRoot更改爲指向public目錄?

+0

如果我能,將工作,但我不能這樣做,在這裏。抱歉。 – PiTheNumber 2013-03-19 12:47:30