Search code examples
regexapache.htaccessmod-rewriteuwamp

.htaccess file configuration for Windows localhost


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

Solution

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

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