apache - Too many redirects error and browser shows -
with reference htaccess rewriterule redirecting parent directory?
thank francesco casula, answer helpful, application redirects 1 document root other. facing infinite redirects issue.
i have following repositories different version.
- /var/www/portal/version/1.1.1/public/ binded (api.somedomain.com)
- /var/www/portal/version/1.1.2/public/
- /var/www/portal/version/1.1.3/public/
- /var/www/portal/version/1.1.4/public/
i want execute api in following order (by version)
api.somedomain.com/qr ---> /var/www/portal/version/1.1.1/public/
api.somedomain.com/v2/qr ---> /var/www/portal/version/1.1.2/public/
api.somedomain.com/v3/qr ---> /var/www/portal/version/1.1.3/public/
api.somedomain.com/v4/qr ---> /var/www/portal/version/1.1.4/public/
my httpd.conf is
aliasmatch ^/v2/(.*)$ "/var/www/portal/version/1.1.2/public/" <directory "/var/www/portal/version/1.1.2/public"> options indexes followsymlinks multiviews allowoverride order allow,deny allow </directory> . . aliasmatch ^/v4/(.*)$ "/var/www/portal/version/1.1.4/public/" <directory "/var/www/portal/version/1.1.4/public"> options indexes followsymlinks multiviews allowoverride order allow,deny allow </directory>
and .htaccess in /var/www/portal/version/1.1.4/public/ contains
<ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on # redirect trailing slashes... rewriterule ^(.*)/$ /$1 [l,r=301] rewritecond %{request_uri} ^/v2/(.*)$ rewriterule ^(.*)$ v2/index.php [qsa,l] # p2 symlink name! # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] </ifmodule>
when hit https://api.somedomain.com/v2/invitebysms
i many redirects error , browser shows
i think you're going following:
alias /v4/ /var/www/portal/version/1.1.4/public/ <directory /var/www/portal/version/1.1.4/public/> require granted fallbackresource /v4/index.php </directory>
in far understand you're trying accomplish, above, in server config (delete .htaccess file entirely) want. (repeat v2, v3, , on.)
i assuming here you're running @ least 2.2.16 or later, , preferably 2.4. if not, let me know, , we'll try again.
Comments
Post a Comment