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.)?mustermann.de$

RewriteCond %{REQUEST_URI} ¶¶Subfolder/ ¶¶

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

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

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

Replace mustermann.de, "subfolder" and index.php with your desired data:

mustermann.de = 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?

Support

Telephone support

Domains worldwide

Europe

  • .at
  • .ch
  • .de
  • .eu
  • .fr
  • .it
  • .nl
  • .uk
  • .es
  • .pl
  • .me
  • .li

Asia

  • .ae
  • .cn
  • .hk
  • .in
  • .io
  • .jp
  • .my
  • .la
  • .sg
  • .tw
  • .ps

Generic

  • .biz
  • .com
  • .info
  • .mobi
  • .net
  • .org
  • .travel
  • .xxx
  • .pro
  • .jobs
  • .name
  • .aero

New domain extensions

  • .online
  • .sale
  • .reise
  • .hotel
  • .xyz
  • .ruhr
  • .restaurant
  • .coupon
  • .video
  • .bayern
  • .berlin
  • .hamburg
  • .koeln
  • .london
  • .reisen
  • .saarland
  • .wien
  • .bio
  • .business
  • .events
  • .haus
  • .immo
  • .immobilien
  • .international
  • .versicherung

Companies that trust us

Other products you might be interested in

Webhosting
Concentrate fully on your project! Performance and security included.
Rankingoach
Optimize your Web site and achieve top rankings.
Website optimization
SSL Certificates
For your site, more safety protect yourself from hacker attacks.
Quickly protect