Solution to Drupal site's page's URL all contains its root path

I had a Drupal project where the website is hosted in shared web hosting and the issue was all its page's URL contains root path like for example: http://example.com/home/roland/public_html/contact (this URL should only be http://example.com/contact if without root path). We know that in shared hosting we don't have control in Apache web server's configuration files but we do only have the .htaccess to do some Apache stuffs. How can we remove the root path /home/roland/public_html from all our Drupal site's URL?

To solve this issue, open and edit your .htaccess file. Search and uncomment the line that contains the following:

      
RewriteBase /
      
    
Tags

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.