Answers.Body: <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-11T12:17:10.310Z
Answers.LastActivityDate: 2023-09-11T12:17:10.310Z
Answers.UserDisplayName: Kenneth
Body: <p>I have a website that is hosted on a subdomain, let's say: <code>https://subdomain.maindomain.nl</code>.</p>
  <p>My craft content is in the <code>maindomain/public_html/subdomain/git-module </code>
  To make it work on the subdomain I added an htaccess file in the <code>maindomain/public_html/subdomain</code> with the following content:</p>
  <pre><code>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]
  </code></pre>
  <p>For the front-end it is working. You can see everything on the <code>https://subdomain.maindomain.nl</code> url, but for the dashboard (which in this case is used for users as well, it still shows the whole url including <code>/git-module/web</code> like <code>https://subdomain.maindomain.nl/git-module/web/admin</code>.</p>
  <p>My question is how I can delete this <code>/git-module/web</code> part of the url.</p>
  
Tags: <craft3><redirect><htaccess>
Title: Redirect control panel access via .htaccess
ThreadText: # Redirect control panel access via .htaccess
  
  (Asked by: username_0 on 2023-09-05)
  
  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.
  
  **Tags:** craft3, redirect, htaccess
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-09-11. Score: 0
  
  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.
  
  
  ---
  
  