Mobile app version of vmapp.org
Login or Join
Megan663

: Edit .htaccess so that homepage of Laravel site mirrors homepage blog I have a Laravel site at example.com and a WordPress site at blog.example.com. Everything works well except that I'd love

@Megan663

Posted in: #Apache #Htaccess #Mirror #Subdomain

I have a Laravel site at example.com and a WordPress site at blog.example.com.

Everything works well except that I'd love to have the root (index page) of example.com show (but not redirect to) the root of blog.example.com.

My Laravel .htaccess file is below.

How can I change this (or what else should I do if not editing .htaccess) so that the homepage of my Laravel site mirrors the homepage of my blog?

Both sites are hosted on the same Cloudways server.

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>

RewriteEngine On

#--------
# remove www subdomain (https://stackoverflow.com/a/1270281/470749)
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ %1/ [R=301,L]
#--------

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

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

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Megan663

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme