是的,这是可能的。我提到 here应该为你工作。
要使它工作,您应该修改Laravel和Wordpress .htaccess
文件。
Laravel .htaccess
例如:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
#Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/blog/ # <=== NEW LINE!!!!
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
</IfModule>
的WordPress .htaccess
例如:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/ # <==== CHANGED LINE!!
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L] # <==== CHANGED LINE!!!
</IfModule>