ZioCain
ZioCain

Reputation: 439

HTAccess redirect everything to folder except specific URL

I really dunno much about HTAccess, but here's what i have to do:

if the path is like domain.it/installatori then it will just call the pages within the /installatori folder

otherwise use existing code (which is what follows):

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [R=301,L]
</IfModule>

I know it's probably a dummy question with a really easy solution, but i just don't know it and can't find anything helping me

NOTE: the website is build with laravel and the other subwebsite in the installatori folder is another laravel website, each of these website have their own routing algorithm

Upvotes: 2

Views: 826

Answers (2)

Kayode Ibrahim
Kayode Ibrahim

Reputation: 126

based on the question.if your url is domain.it/installatori

 Options -Indexes

ErrorDocument 404 /404.php
ErrorDocument 403 /404.php


        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^domain.it/installatori $
        RewriteCond %{REQUEST_URI} !^/public/
        RewriteRule (.*) /public/$1


Upvotes: 1

anubhava
anubhava

Reputation: 785246

Change your rule to this:

RewriteEngine on

RewriteCond %{REQUEST_URI} !^/(public|installatori) [NC]
RewriteRule ^(.*)$ public/$1 [R=301,L]

And remember to clear your browser cache.

Upvotes: 3

Related Questions