jeudi 5 mai 2016

WordPress in Laravel public folder returns 404 not found

I've a laravel installed in /dev.domain.com/ and RootDocument is set to /http://ift.tt/1XatCc3

The laravel works without any problem and then I install WordPress in newly created directory named "blog" under the laravel's public folder

Wordpress path : /http://ift.tt/1Tplvme

On localhost I'm can access /blog and setup wordpress as usual, however the problem come with I deploy to live server by cloning with git. The laravel path works fine but when I try to access /blog directory in public folder it returns 404 Not found

Below is the Laravel

/http://ift.tt/1XatCc5

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

    RewriteEngine On

    # Redirect non ssl to ssl
    # and don't redirect subdomain
    RewriteCond %{HTTP_HOST} ^dev\.domain\.com [NC]
    RewriteRule ^(.*) - [L]

    RewriteCond %{HTTP_HOST} ^domain\.com [NC]
    RewriteRule ^(.*) http://ift.tt/1dx3YFa [L,R=301]

    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]

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

and Wordpress

/http://ift.tt/1TplvCy

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/

# Disable WordPress front-end
RewriteCond %{REQUEST_URI} !/wp-admin
RewriteCond %{REQUEST_URI} !/wp-includes
RewriteCond %{REQUEST_URI} !/wp-login\.php$
RewriteCond %{REQUEST_URI} !/wp-content
RewriteRule (.*) https://www.domain.com/ [R=301,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

I've tried to add this one but no chance to make it works

RewriteCond %{REQUEST_URI} !^/blog

Above

RewriteRule (.*) https://www.domain.com/ [R=301,L]



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1XatCc7
via IFTTT

Aucun commentaire:

Enregistrer un commentaire