2013-02-13 33 views
0

我們的主站點運行joomla 1.5並在子文件夾中的Codeignter上創建了額外的應用程序。更改htaccess Joomla在子文件夾中使用CI

當我打開應用程序索引目錄網址 - www.mysite.com/app - 沒關係,但如果我嘗試使用更深的應用程序,如www.mysite.com/app/controller/view - 我得到傳統的joomla 404頁。

問題是,joomla .htaccess中的規則適用於指向服務器上真實文件夾的任何url - 對於一個級別,但我怎麼能使它在真正的子文件夾內的joomla NOT_WORK。

CURENT的Joomla htaccess的是:

Options +FollowSymLinks 
RewriteEngine On 

RewriteBase/

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !^/index.php 
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC] 
RewriteRule (.*) index.php 
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] 

########## Begin - Rewrite rules to block out some common exploits 
## If you experience problems on your site block out the operations listed below 
## This attempts to block the most common type of exploit `attempts` to Joomla! 
# 
## Deny access to extension xml files (uncomment out to activate) 
#<Files ~ "\.xml$"> 
#Order allow,deny 
#Deny from all 
#Satisfy all 
#</Files> 
## End of deny access to extension xml files 
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] 
# Block out any script trying to base64_encode crap to send via URL 
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] 
# Block out any script that includes a <script> tag in URL 
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] 
# Block out any script trying to set a PHP GLOBALS variable via URL 
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] 
# Block out any script trying to modify a _REQUEST variable via URL 
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 
# Send all blocked request to homepage with 403 Forbidden error! 
RewriteRule ^(.*)$ index.php [F,L] 
# 
+0

是否使用一個htaccess文件中的'app'文件夾以及?如果是這樣,你能包括什麼嗎? – 2013-02-13 18:39:15

回答

2

您可以添加到RewriteCond %{REQUEST_URI} !^/app .htaccess文件。

所以它看起來像這樣:

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !^/index.php 
RewriteCond %{REQUEST_URI} !^/app 
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC] 
RewriteRule (.*) index.php 
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] 

您還可以添加這樣的.htaccess文件到您的app文件夾:

RewriteEngine on 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /app/index.php/$1 [L] 
相關問題