2

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
anubhava
  • 761,203
  • 64
  • 569
  • 643
Z55
  • 85
  • 5

1 Answers1

2

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

RewriteEngine On
RewriteBase /work1/

RewriteRule ^((?!public/).*)$ public/$1 [L,NC]
anubhava
  • 761,203
  • 64
  • 569
  • 643
  • Hi, thank you, Internal Server Error. Error.log appache:C:/UwAmp/www/work1/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration – Z55 Dec 09 '14 at 19:24
  • That means you haven't enabled `mod_rewrite` in Apache config. Make sure to enable `mod_rewrite` and `.htaccess` through `httpd.conf`. – anubhava Dec 09 '14 at 19:27