简体   繁体   中英

htaccess redirect to subfolder results in too many redirects

I am currently working with some software called sendy . I want to redirect the url mydomain.com/sendy to the sendy folder in the root directory. I am using Laravel on a shared account with other htaccess configurations after the one below. I put the sendy redirect first as a result. However I get the error

The website has a redirect loop 

I am no expert on .htaccess files so any help would be great as to what may be causing the issue. What I have currently now is shown below:

# Use PHP5.4 as default
AddHandler application/x-httpd-php54 .php

#AddType application/x-httpd-php54 .php


RewriteEngine on
RewriteRule ^/?sendy/ /sendy/? [R=301,L]
RewriteCond %{HTTP_HOST} ^(www.)?mydomain.com$ 
RewriteCond %{REQUEST_URI} !^/public/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /public/$1 
RewriteCond %{HTTP_HOST} ^(www.)?mydomain.com$ 
RewriteRule ^(/)?$ public/index.php [L]

Thank you!

To ignore folder sandy from rules below just use this rule instead:

RewriteCond %{THE_REQUEST} /sendy [NC]
RewriteRule ^ - [L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM