Fantastic Support

How can I refer to a subfolder via htaccess?

For example, if you have a website in a subdirectory, but it is now is to appear directly when the domain is called, you can change this via a htaccess file.

In this tutorial, we will show you how to do this.

Step 1

Open a text editor and create a file with the following contents:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?$

RewriteCond %{REQUEST_URI} ¶¶Subfolder/ ¶¶

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /subfolder/$1

RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule ^(/)?$ subfolder/index.php [L]

Replace, "subfolder" and index.php with your desired data: = your domain.

"subfolder" = The subdirectory in which the website is located.

index.php = can remain, unless an index.html or index.htm should serve as start page

Then save this file as ".htaccess".

Step 2

Open an FTP program such as FileZilla and load the file into the Main directory of your domain (default: /htdocs).

Htaccess forwarding is active immediately.

Was this article helpful?

Thank you very much for your review!

Thank you very much for your review!

You have already rated this item.

Thank you for your time.

Do you require assistance?


Telephone support

Companies that trust us

Other products you might be interested in
Website Builder
Create your own website without any programming knowledge.
Create a Website
Concentrate fully on your project! Performance and security included.
Optimize your Web site and achieve top rankings.
Website optimization
SSL Certificates
For your site, more safety protect yourself from hacker attacks.
Quickly protect