Souvik Banerjee
Souvik Banerjee

Reputation: 197

How to serve content from Subfolder with htaccess

Does anyone know if I can serve content from http://example.com/folder/public/, when a person visits http://example.com/folder/ exact file will help.

Upvotes: 1

Views: 349

Answers (1)

anubhava
anubhava

Reputation: 785058

Place this .htaccess in /folder/.htaccess:

RewriteEngine On
RewriteBase /folder/

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

Upvotes: 3

Related Questions