Laravel is one of the highly used, open-source modern web application frameworks to designs customized web applications quickly and easily. Developers prefer Laravel over to other frameworks because of the performance, features, scalability it offers, and on the other hand, WordPress is one of the most popular open source content management applications to develop Blog, Forum, and news feed, because of it vertical features and available plugin bank.
So today we thought why not get our hands dirty with this two together, and help our readers to give good headstart. In this series, we will be explaining how to install WordPress inside a Laravel application and get the WordPress post into Laravel.
Assuming we have a Laravel website running on
example.com and its physical path is
/public_html/. Now we want to create a Blog using WordPress as
example.com/blog/, so we need to install WordPress in
/public_html/blog/. Upload all the WordPress files in /blog/ directory. Now we have have edit the
.htaccess of both the application so that Laravel should escep blog request for WordPress to process it.
.htaccess for Laravel
RewriteCond $1 !^(blog) #
.htaccess for WordPress
# BEGIN WordPress
RewriteBase /blog/ #
Now we can directly access
example.com/blog/wp-admin/ to install WordPress and set the permalink structure to
Post name or any other beautiful URL structure.
In Next tutorial we'll be learning as how to access WordPress post in Laravel.