2

I have a subdomain that I want to make the root folder to "Public_html", for example, my root subdomain is

- /public_html/subdomain

So I want to change that path to just /public_html/ for my subdomain. I know it can be done with .htaccess, but I dont know how to do it. Thanks...

dreamcrash
  • 36,542
  • 23
  • 64
  • 87

1 Answers1

1

I don't know exactly what you want, but here are my two answers:

Answer 1: You want your DocumentRoot to point to public_html

In this case add/change the DocumentRoot in your (virtual) host config of your webserver (I'm assuming you're using Apache, which would be /etc/httpd/conf/httpd.conf or /etc/httpd/conf/extra/httpd-vhosts.conf or even /etc/apache2/sites-enabled/yourhost)

Answer 2: You want to redirect from your subdomain folder to the root of public_html

This is not possible via a simple RewriteRule due to the fact, that your host is pointing to the subdomain folder. The other way round would possible (redirecting from public_html to subdomain).

What you can to is to create a symbolic link from subdomain which points to public_html or a file in it - but I don't recommend this.

Furthermore resources:

Community
  • 1
  • 1
akluth
  • 7,787
  • 4
  • 34
  • 41