How to change the root of my site, since the folder is on a level above?

Asked

Viewed 705 times

-1

My doubt is in the escalation of .htaccess, because I can only make the root of my site the folder public_html or some other folder inside public_html, but I need a folder that’s one level up.

RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} ^www.meusite.com.br/$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.meusite.com.br/$
RewriteCond %{REQUEST_URI} !meudiretorio/
RewriteRule (.*) /meudiretorio/$1 [L]
  • Being your directory /var/www/public_html, you need to access /var/www/outra_pasta?

  • Exactly, I want my root folder to be another.

1 answer

1

This is not done in the .htaccess.

You must change the Apache configuration in httpd.conf. See Documentroot.

  • I understood, but the path that is in the documentation is different and I can’t find this file. Is there anywhere in cPanel that I can change the file?

  • See if this link helps you https://support.hostgator.com/articles/what-is-a-document-root-folder

  • I haven’t been able to locate yet, the document only shows me how to make this change in subdomains, but when it’s in the primary domain I can’t find the information.

  • Here is information to change the primary domain. I haven’t worked with CPANEL for a long time so I can’t steer better. But why you need to change the documentroot for the primary domain?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.