0

I have a blog folder in my servers /home/app/sites directory, and I have my laravel app in /home/app/public_html/laravel and my domain www.laravelapp.com is pointing to the project.

I want to point the url www.laravelapp.com/blog to my blog folder in /home/app/sites/blog.

How can I do that?

Here is my .htaccess file:

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

RewriteEngine On

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

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect blog folder (Not working)
RewriteCond %{HTTP_HOST} ^www.laravelapp.com/blog$ [NC]
RewriteRule ^(.*)$ /home/app/sites/blog [L,R=301]
</IfModule>
Adam Silva
  • 1,013
  • 18
  • 48

1 Answers1

0

../ goes one folder down

So it should be ../../sites/blog

There may be restrictions with htaccess. If this not already work share your .htaccess file. You cant go behind your base url, the following question explains it very well.

Having links relative to root?

Doomenik
  • 868
  • 1
  • 12
  • 29