Yes, it will work properly. It's you're choice on where you put the wordpress codebase and how you reference it (rewrites).
At a very low level, you could put your wordpress folder inside of your public folder (you'll probably want to rename the WP folder to what you want for subdomain
) as rewrites in Laravel get skipped when there is an actual directory or file in the path. That's not great for security, but you can mitigate by putting your config file outside of the public folder and include it within the existing wp-config.php file.
Using rewrites in Nginx or Apache, you have more options on where you can place the WP instance.
On a side note, I think you might be confusing subdirectories with subdomains. It looks like you're just looking to add a subdirectory to your main domain. A subdomain would be subdomain.domain.com rather than www.domain.com/subdomain.
Good luck!
I renamed server.php to index.php and copied the /public/.htacces into the root folder. I have my WordPress installation in a sub-folder /wp and I am trying this in the .htaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>
# END WordPress
</IfModule>
Please tell me why browsers are complaining that the page is not redirecting properly when I try to go to www.domain.com/wp. What did I mess up?
shouldn't be a problem at all. i would setup two virtual hosts and point them to separate directories. so your wordpress and laravel apps are isolated from each other physically.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community