Skip to content

Instantly share code, notes, and snippets.

@velosipedist
Last active December 25, 2015 10:59
Show Gist options
  • Save velosipedist/6965760 to your computer and use it in GitHub Desktop.
Save velosipedist/6965760 to your computer and use it in GitHub Desktop.
Change web root using .htaccess. Can be used in Laravel bootstrapped app, or in any project under localhost with spec
# for example, we are in /www/htdocs/myproject
# but webroot situated in /www/htdocs/myproject/public_html
# let's create /www/htdocs/myproject/.htaccess
RewriteEngine on
RewriteCond %{REQUEST_URI} !public_html/
RewriteRule (.*) public_html/$1 [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment