重述问题(根目录中的站点+子文件夹中的站点)

时间:2018-07-31 10:37:26

标签: .htaccess redirect url-rewriting

我有问题...

我有两个站点,一个在根目录(Joomla 1.5站点),另一个在子文件夹(OJS站点):

www.mysite.it (Joomla网站)

www.mysite.it/subfolder (OJS网站)

由于某些原因,我不知道通过输入URL www.mysite.it/subfolder 无法访问OJS网站 但只能输入地址 http://www.mysite.it/subfolder/index.php/magazine/index

如何通过仅键入内容来重定向网站 www.mysite.it/subfolder

我在根目录中的 .htaccess 包含以下内容:

DirectoryIndex index.php RewriteEngine On RewriteBase /

RewriteRule ^subfolder/?$ /subfolder/index.php/magazine/index/$1 [L,NC]

########## 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
# Block out any script trying to set a mosConfig value through the URL 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]
#
########## End - Rewrite rules to block out some common exploits

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]

提前感谢您的宝贵建议!

0 个答案:

没有答案