Install Wordpress with Laravel on the same domain in the blog folder
I have a laravel installation on the same .com domain. The site is launched. I need to install wordpress in the blog folder at domain.com/blog. when i try to install wordpress it prevents me from starting the installation and says "This web page has a redirect loop". I installed wordpress using domain.com/blog/index.php but after installation I was unable to start the wordpress blog from domain.com/blog/
I have given appropriate permissions for the wordpress blog folder.I will manage wordpress from laravel blog admin and site from laravel section.
I saw https://laracasts.com/discuss/channels/general-discussion/install-wordpress-in-domaincomblog but couldn't get it to work.
WorkspaceMu: Xampp in Ubuntu
Any suggestions would be helpful.
source to share
this line in .htaccess is probably your culprit:
RewriteRule .*/$ /$1 [L,R=301]
please comment on this and see what solves your problem.
This line makes everything in the public domain go through the laravel router. Perhaps you could leave it by writing another regex above this line specifically targeting the / blog directory, or rewrite this line to direct anything that! = Your blog directory.
You should really leave this line there if possible.
Add below lines to .htaccess
RewriteCond $1 !^(bmcblog)
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
It will look like
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond $1 !^(bmcblog)
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [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>
source to share