Siteground: Q/A

How to change my root folder of documents through the .htaccess file?

Siteground
964

From the start your website is loaded from folder that called “public_html”. This directory is also called the root directory. If you made new (or test) website in a sub-folder and you want the site to be shown when you type the domain name of your web site, then add lines listed below to your .htaccess file in the root folder: RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomainname.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.yourdomainname.com$
RewriteCond %{REQUEST_URI} !folder/
RewriteRule (.*) /folder/$1 [L]

Change following in the above lines:
domain-name.com – Domain name of your site.

folder – Subfolder that contains the test web site files.

You can use cPanel->File Manager to create new .htaccess file if there is no file in the public_html folder.

Then just type domain name of your site, and your browser should show the test website.

Hosting Packages:

Line numberWEB HOSTPLANOPTIONSThe cost of web hosting per month for annual plan, based on the providers least expensive plan.PRICEUSERS RATINGMORE INFO
1
SitegroundAdd to compareStartUP
Disk space:10 GB
Bandwidth:Unlimited
Platform:Linux
Money back:30 days
Databases:Unlimited
Setup:Free
Visit site
$10.76updated:
Nov 12, 2018
4.2
Hosting overviewVisit sitePartnerCoupons
2
SitegroundAdd to compareGrowBig
Disk space:20 GB
Bandwidth:Unlimited
Platform:Linux
Money back:30 days
Databases:Unlimited
Setup:Free
Visit site
$19.41updated:
Nov 12, 2018
4.2
Hosting overviewVisit sitePartnerCoupons
3
SitegroundAdd to compareGogeek
Disk space:30 GB
Bandwidth:Unlimited
Platform:Linux
Money back:30 days
Databases:Unlimited
Setup:Free
Visit site
$32.39updated:
Nov 12, 2018
4.2
Hosting overviewVisit sitePartnerCoupons
4
SitegroundAdd to compareEntry Server
Disk space:500 GB
Bandwidth:5000 GB
Platform:Linux
Setup:Free
Ram:4 GB
Cpu:Intel i3-540
Visit site
$236.82updated:
Nov 23, 2018
4.2
Hosting overviewVisit sitePartnerCoupons
5
SitegroundAdd to comparePower Server
Disk space:1000 GB
Bandwidth:5000 GB
Platform:Linux
Setup:Free
Ram:12 GB
Cpu:Intel Xeon E3-1230
Visit site
$323.33updated:
Nov 23, 2018
4.2
Hosting overviewVisit sitePartnerCoupons
Add Hosting Plan
Please enter captcha code
captcha
Send