Skip to content

Instantly share code, notes, and snippets.

@Edwardtonnn
Created September 25, 2018 19:28
Show Gist options
  • Save Edwardtonnn/7046d113f90fd52d0c8e639f5f61ec65 to your computer and use it in GitHub Desktop.
Save Edwardtonnn/7046d113f90fd52d0c8e639f5f61ec65 to your computer and use it in GitHub Desktop.
rewrite site to subsolder
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain-name.com$
RewriteCond %{REQUEST_URI} !folder/
RewriteRule (.*) /folder/$1 [L]
In the above lines you should replace the following:
domain-name.com - Type your own domain name
folder - Type the name of the subfolder which has the test/development website
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment