user4239
user4239

Reputation: 23

Laravel installation with wordpress blog out of the public folder

I have a Laravel installation and a Wordpress instalation in diferent folders but in the same server

laravel.site.com (domain and folder with all laravel files)

wordpress.site.com (domain and folder with all wp files)

but I need to make the wordpress blog can be accessed in this url laravel.site.com/blog

I have tried adding this to the laravel public htaccess

RewriteCond %{REQUEST_URI} !^/blog/

and I changed the wordpress WP_SITEURL but it does not work it show 404

I also checked the laravel routes and it only have

Route::get('/', function () {
    return view('welcome');
});

I have tried many similar questions without result, any idea of how to fix this?

Upvotes: 1

Views: 504

Answers (1)

Ehsan
Ehsan

Reputation: 161

Put wordpress files within "public" folder in a folder say "blog". Change the .htaccess file of Wordpress to below

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress

Your site url within wordpress should be "http://laravel.site.com/blog"

Upvotes: 1

Related Questions