How to make subdomain point to a custom folder with Laravel installed in the root?


I have Laravel installed in public_html folder and I have a subdomain when I open it, I get This site can’t be reached and when I navigate to it worked. How to make the subdomain point or map to this path and ignore Laravel routing? I tried

RewriteCond %{HTTP_HOST} ^
RewriteCond %{REQUEST_URI} !^/x/
RewriteRule (.*) /x/$1 [L]

before Laravel redirection

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

But it didn’t work

Source: Laravel

Categorised as laravel, redirect, routes, subdomain Tagged , , ,


Leave a Reply

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us