• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question DocumentRoot settings are ignored

Johannes Kingma

Basic Pleskian
I have a website siting at /httpsdocs/name
I I specify as Documeent Root in hosting settings /httpsdocs/
and I have a .htacess directing to /name everything works

If I set a Document root /httpsdocs/name and remove the .htacess I get a 404

Don't want a .htacess redirect, but want plesk to set the proper DocumentRoot.

What is wrong here?
 
The 404 is likely coming from a software installed in /httpsdocs/name, not from a web server function or Plesk. If you are using a software like Wordpress, you might need to update the siturl and homepage datasets in the ?_options-table to use the correct URL if you make changes to the URL path. There could also be other redirects in the /httpdocs/name/.htaccess file that point to a wrong subdirectory so that files cannot be found by rewrite rules.,
 
Thanks Peter, No it is not a WordPress site.
In the file manager the website root is /httpsdocs/name
At hosting settings the Document Root is specified as /httpsdocs/name
The domain is listed as : "Website at httpsdocs/name", when I click on the File Manager I'm redirected to the correct (root)folder (where there is a index.php)

Yet without a .htaccess in /httpsdocs the website does not work and does not show the content of /httpsdocs/name/index.php.
The .htaccess at /httpsdocs contains:
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !name/
RewriteRule ^(.*)$ /name/$1

without this htaccess a test file index.php sitting in /httpsdocs/ is opened not the one in /httpsdocs/name so I can only conclude the last part of the configuration of /httpsdocs/name is ignored
 
Last edited:
After you have changed the document root setting in "hosting settings" of Plesk for that domain, did you wait until the server restart interval has expired so that the new server configuration actually becomes active?
 
The setting to /httpsdocs/dwh was done about 12hrs ago. I currently test by renaming .htaccess. So yes I guess the restart interval did expire. Is there a way to confirm this?
 
The .htaccess only exists in /httpdocs/ not in the subfolder. its contents
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !dwh/
RewriteRule ^(.*)$ /dwh/$1

which does redirect all requests to /httpsdocs/dwh. (But if the DocumentRoot is /httspdocs/dwh it would in principle redirect to /httpdocs/dwh/dwh)
 
And I have to apologize, wanted to anynomise this question be using "name" instead of "dwh" but forgot that halfway.
So the contents of /httpsdocs/dwh contains index.php
but it can only be found with the .htaccess redirect, although the Webhosting settings has "httpsdocs/dwh" as Document Root.
 
"httpsdocs/dwh" is not "httpdocs/dwh". Are you sure you are addressing the correct directory? Normally it should be /httpdocs.
 
Back
Top