.htaccess file configuration for Windows localhost

605 Views Asked by At

how substitute content from "work1/public" subdirectories when you enter aaa.aaa/work1 ?

I tested

RewriteEngine on
RewriteRule (.*) /work1/public/

But it only works when you are asking for something

http://aaa.aaa/work1/foo

http://aaa.aaa/work1/bar

if nothing is entered

http://aaa.aaa/work1

rule does not work :-(

can anyone help me ?

Thank you very much

aaa.aaa === localhost
1

There are 1 best solutions below

2
On BEST ANSWER

Place this code in your /work1/.htaccess file:

RewriteEngine On
RewriteBase /work1/

RewriteRule ^((?!public/).*)$ public/$1 [L,NC]