Skip to content

Instantly share code, notes, and snippets.

@om-mahato
Created August 2, 2020 13:51
Show Gist options
  • Save om-mahato/315272a9925b4974ef33b69cbf4bd7ac to your computer and use it in GitHub Desktop.
Save om-mahato/315272a9925b4974ef33b69cbf4bd7ac to your computer and use it in GitHub Desktop.
Apache .htaccess file to redirect all trafic to public folder
#.htaccess
RewriteEngine On
RewriteBase /My-Project/
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
RewriteRule ^ %1 [L,NE,R=302]
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment