1

I installed Drupal 7 through the hosting service tools, which installed Drupal inside the drupal1 folder. All the site URLs contain the folder name.

How can I avoid the URLs contain that folder name? For example, instead of http://example.org/drupal1/about-us, the page should be available as http://example.org/about-us.

I've been able to only set the default front page alias to the root.

1
  • Your domain needs to be pointed to the /drupal1 folder. Normally there is an option somewhere in a hoster's settings panel. This is no specific Drupal question. So I'd say your hoster may answer this question as well.
    – leymannx
    Sep 23, 2018 at 2:36

1 Answer 1

1

Set server DocumentRoot to Drupal folder

As mentioned by @leymannx you have to configure your server virtual host to use the drupal1 as the DocumentRoot.

<VirtualHost *:80>
    ...
    DocumentRoot /path/to/drupal1/

    <Directory /path/to/drupal1>
      AllowOverride All
    </Directory>
    ...
</VirtualHost>

RewriteBase on a shared host (in Drupal .htaccess)

If you're on a shared host you won't have access to change DocumentRoot. Instead, you can adjust RewriteBase in Drupal .htaccess file (or $base_url in settings.php).

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a  
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
RewriteBase /drupal1
1
  • Thanks @prkos I tried both the .htaccess and settings.php but no luck. I'll contact my web hosting company and have them make the change to the VirtualHost DocumentRoot. Sep 24, 2018 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.