Subdomain always redirect back to main domain, how to fix it?
I created a sub domain (sub.example.com) which should be redirecting to public_html/sub/index.php
but it is not working as it’s always redirecting back to main domain (example.com). I don’t understand why this happening, possible mistake in the .htaccess ? I’m using laravel btw
RewriteEngine On
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^((?!www).+.sub.example.com)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
from Laravel Questions and Answers https://laravelquestions.com/php/subdomain-always-redirect-back-to-main-domain-how-to-fix-it/
via Lzo Media
No comments:
Post a Comment