admin管理员组文章数量:1410737
I am facing a particular request from the SEO team of a client and I need to handle two different CMS served on the same domain. Basically, the "root" cms is already configured in order to map all requests on the first CMS, where an .htaccess configuration is then handling the url in order to map proper parameters to the system.
The second CMS should act when the url contains a specific string, but the particular request is that the string is not at the beginning of the url, but has some parameters before. So I cannot use the Alias directive as other directories in the VirtualHost configuration and I am considering using AliasMatch instead.
To recap, the second CMS should serve responses when a url matches the "second-cms" keyword in the url:
/param1/param2/second-cms/param3/param4/param5/...
My tentative is to use this configuration in the VirtualHost:
AliasMatch /second-cms/ /var/www/second-cms/
<Directory /var/www/second-cms/>
AllowOverride all
Order allow,deny
Require all granted
Allow from all
Options FollowSymLinks
</Directory>
But what I get is an infinite redirect loop - in the browser address bar I see the url followed by repeated /index.html/index.html/index.html/index.html and so on string.
Please note that in the /var/www/second-cms/ dir there is also a .htaccess file (created and working in dev environment, with a simple Alias directive in the VirtualHost configuration) like this:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
Options +Indexes
RewriteEngine on
RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{HTTP_REFERER} ^(https?://[^/]+/.*/)
RewriteRule (.*)\.html$ %1$1 [R=301,L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?uri=/$1 [NC,L,QSA]
</IfModule>
<FilesMatch ".(ico|jpg|jpeg|png|gif|js|css)$">
Header set Cache-Control "max-age=63072000, public"
</FilesMatch>
At first sight I thought that the redirect loop was because of some conflict between the AliasMatch directive and the .htaccess, but also removing the .htaccess from the destination directory i get the same infinite loop problem.
本文标签: Apache AliasMatch map certain directory when matching specific stringinfinite loopStack Overflow
版权声明:本文标题:Apache AliasMatch: map certain directory when matching specific string - infinite loop - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744899675a2631271.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论