Last active
October 10, 2023 12:16
-
-
Save ianpegg/5be8cff25744391017069d3d703229b3 to your computer and use it in GitHub Desktop.
cPanel Web Root Rewrite: rewrite all traffic to go via 'web' directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# Rewrite all traffic to go via 'web' directory (Bedrock requirement) | |
# ---------------------------------------------------------------------- | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Adapted from: https://www.siteground.com/kb/how_to_change_my_document_root_folder_using_an_htaccess_file/ | |
RewriteCond %{HTTP_HOST} ^example.(org.uk|test)$ [NC,OR] | |
RewriteCond %{HTTP_HOST} ^(staging|www).example.(org.uk|test)$ | |
RewriteCond %{REQUEST_URI} !web/ | |
RewriteRule (.*) /web/$1 [L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment