skip to Main Content

My website is a WordPress and it seems to be available only at https://arch-doc.com/www

My configuration on OVH is enter image description here

On the base path, it show us the Index Of webpage.

Any advice to handle this issue?

2

Answers


  1. Your web root contains nothing that tells the server what to render, so it falls back on indexing the folder’s content.
    What we need to change this is a .htaccess-file in this directory with rules to rewrite the request to the subdirectory. There’s a article from the WordPress documentation that covers this use case and that I’m working from.

    Here’s the content of the .htaccess-file you would put into your web root:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?arch-doc.com$
    RewriteCond %{REQUEST_URI} !^/www/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /www/$1
    RewriteCond %{HTTP_HOST} ^(www.)?arch-doc.com$
    RewriteRule ^(/)?$ www/index.php [L]
    </IfModule>
    

    This should be it. Just refresh your browser (ctrl-F5, to clear your cache just to be safe 🙂 ) and you should be golden.

    Login or Signup to reply.
  2. From what I understand, you want https://arch-doc.com/ and https://www.arch-doc.com/ to display your website. And not https://arch-doc.com/www/

    Assuming that your WordPress is in your folder "www" with files as shown in the image below,to solve your issue you have to define the "Root Folder" ("Dossier racine") to "www" and remove all other redirection.

    OVH WordPress www folder

    Modify "Root Folder"

    To change the "Root Folder" of "arch-doc.com", follow these steps:

    1. Click on the 3 dots at the end of the line "arch-doc.com"

    OVH Root Folder change action

    1. Click on "Modify Domain" ("Modifier le domaine")

    OVH Modify Domain

    1. Set the Root Folder to "www". Leave the other options as they are

    enter image description here

    You should now have this display.
    enter image description here

    At this point:

    • when you access the URL https://arch-doc.com/ it will redirect to your "www" folder. The site should correctly display the site.
    • When you access the URL https://www.arch-doc.com/, a permanent redirection is set and will permanently redirect (301) https://www.arch-doc.com/ to https://arch-doc.com/ and thus correctly display your site.
      enter image description here

    For futher information, You can consult the following documentation: OVH "Index of"

    I hope this will help you.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search