Skip to content

Instantly share code, notes, and snippets.

View hermanomark's full-sized avatar
:octocat:
code code code :)

Mark Hermano hermanomark

:octocat:
code code code :)
View GitHub Profile
@hermanomark
hermanomark / gist:55e4dc1f9aa52945b94cc2a043b8cd44
Created February 4, 2019 09:26
Redirect non-www to www in .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
@hermanomark
hermanomark / gist:518337501364cec528309e8d360b03e5
Created February 4, 2019 09:17
How to change my document root folder using an .htaccess file?
RewriteEngine on
RewriteCond %{HTTP_HOST} ^taste.ph$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.taste.ph$
RewriteCond %{REQUEST_URI} !taste/
RewriteRule (.*) /taste/$1 [L]
credits to: https://www.siteground.com/kb/how_to_change_my_document_root_folder_using_an_htaccess_file/