I know this question has been asked many times for the past versions of Drupal, but none of the solutions I've found works for Drupal 7.12.

I used to have an .htaccess file placed inside the document folder alongside with Drupal, and it partially worked on older versions when entering the front- and live-page of my website (which you can now only enter via "default-URL"). For reference, you were able to to enter the live page with http://pavescorner.com/live, but after the patch and some other maintenances on my website, the link has to be like this http://pavescorner.com/drupal/live.

During those tests, when I tried to make another working .htaccess file, I accidentally destroyed the version working for me, and now you can only enter my homepage with the /drupal subdirectory.

What should I put in my .htaccess file so that /drupal doesn't appear in the URLs for my site?

closed as too broad by kiamlaluno May 7 '15 at 9:08

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    You should definitely update your Drupal to the latest version. Then search for a solution to your actual problem. – Елин Й. Jun 17 '14 at 5:37

Using mod_rewrite within .htaccess, in your server's document root. Untested, but something like this should work.

# Enable from .htaccess
RewriteEngine On
Options +FollowSymLinks
# For all URLs not starting with drupal
RewriteCond %{REQUEST_URI} !^/drupal
# Serve the same content from the /drupal directory instead
RewriteRule ^/(.*) http://pavescorner.com/drupal/$1
  • Okay, this seems to working codeline indeed. Except there's one major problem regarding to myself: I'm only familiar with HTML and such, not anything regarding to servers and other network softwares. In other words, I have no idea how to configure this Apache-command in practice. Would there be any actual guides how to do this for a mere "internet browser"? – PaveMentman Mar 4 '12 at 4:25
  • It's actually fairly straightforward: copy the above into a file called ".htaccess" (no file extension, make sure the leading "." is there), and upload it to the root folder on your server. Try accessing pavescorner.com/live after doing so, and post with the results if it doesn't work out. – David Watson Mar 4 '12 at 6:26
  • Ah, it was simply just to create the .htaccess-file after all. Now, I've done this. But unfortunately my homepage open as a blank page (pavescorner.com without "/drupal"), and other pages I enter like the live without /drupal I get a message saying "The requested document was not found on this server." This is when I placed the htaccess-file into my httpdocs, where the Drupal folder itself is located. And the previous working htaccess-file was located there too. – PaveMentman Mar 4 '12 at 16:53
  • Hmm, but I'd have to place the htaccess into "main-top"-folder, then this is going to a little tricky sice I have no persmission to modify/add things there. So I'll have to wait until tomorrow to contact server host to give the permission to add the htaccess-file there. – PaveMentman Mar 4 '12 at 17:07
  • Just to clarify. Do you have anything else being served from subdirectories from your root folder? Because this will redirect all traffic from /* to its counterpart in /drupal/*. If you don't have access to the root folder and/or other content lives there, it may be much more difficult to safely achieve what you're looking for. Knowing what else lives in that root folder would help immensely. – David Watson Mar 4 '12 at 20:48

I guess your root is changed to drupal.

Follow some steps which could help you to solve your problem.

  1. go to etc/hosts file. add your sites address with the name you wanted to set it to be. (Domain name)

e.g.  abc.com 
  1. In httpd.conf file. add following lines which makes your drupal as root.
 <VirtualHost yourproject.com>    
        DocumentRoot path_upto_your_project_directory/yourprojectdirectoryroot   
        ServerName yourproject.com   

hope this will solve your problem.

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