mercredi 25 janvier 2017

Laravel and Wordpress, managing routes

I've an installation of WP in Laravel in folder public/blog. I want to access to WP not with mysite.com/blog but with mysite.com/noticias.

In Laravel .htaccess I've this line to avoid 404 error:

 RewriteCond $1 !^(blog)

so my laravel's .htaccess looks like:

<IfModule mod_rewrite.c>
RewriteBase /
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

RewriteCond $1 !^(blog)

# 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]

I have changed WP HOME_URL to mysite.com/noticias, but if I try to access mysite.com/noticias I get a 404 error if I access to mysite.com/blog WP thows the 404 error.

I've make several tries changing both .htaccess but with out lucky. Any idea?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire