I have a website that is hosted on a subdomain, let's say: https://subdomain.maindomain.nl.

My craft content is in the maindomain/public_html/subdomain/git-module To make it work on the subdomain I added an htaccess file in the maindomain/public_html/subdomain with the following content:

RewriteCond %{HTTP_HOST} ^maindomain.subdomain.nl$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.subdomain.maindomain.nl$
RewriteCond %{REQUEST_URI} !git-module/web/
RewriteRule (.*) git-module/web/$1 [L]

For the front-end it is working. You can see everything on the https://subdomain.maindomain.nl url, but for the dashboard (which in this case is used for users as well, it still shows the whole url including /git-module/web like https://subdomain.maindomain.nl/git-module/web/admin.

My question is how I can delete this /git-module/web part of the url.

1 Answer 1


You should change the subdomain symlink to you the /web folder. By doing so the normal public_html folder becomes the /web root folder for Craft CMS. This is way better than trying to redirect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.