Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I know this question has been asked numerous times during the past versions of Drupal. But once again the systems have changed so much that none of the solutions I've found works on Drupal 7.12.

I used to have a htaccess-file placed inside the httpdocs-folders 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 this link: http://pavescorner.com/live But after the patch and some other maintenances on my website, the link has to be like this now: http: //pavescorner.com/drupal/live (hyperlink limit made me add that space)

During those test when I tried to make another working htaccess-file, I accidentally destroyed it old working one for the home-page, and now you can only enter my homepage with the /drupal subdirector.

So my question is: What kind of htaccess-file codeline thinagmajik I need this time around to replace /Drupal on my whole website (public http-URL-paths, that is)? Or is there another way to hide the /Drupal on the URL-paths?

If you'd need some more infromation, feel free to ask.

And please, the more "practical"-solution you're able to suggest me, the better: I'm not too with cipher nor any other code languages. The less I need to change some codes by my hands, the better.

Edit: Found the old solution I had, it was like this in the htaccessfile:

RewriteEngine on
RewriteRule (.*) drupal/$1 [L]

it was located here: http://drupal.org/node/133532

Inserting this as extra into to the suggested htaccess line did the job too without any conflict. But I used to use/tested this code alone too. In other words, those two lines enough ennable clean frontpage url alongside the sites/defaults/(default)settings.php

Edit 2: I've celebrated slighty too early, since as i've cemmented below, found that the old bugger has returned, which I call "autohomer". Which means that every direct link without /drupal now only leads to homepage while still retaining the inserted url (ie. .com/live). I'm starting to feel that i'd also need to configure the /sites/defaults/settings.php too into something that just only my homapage.

share|improve this question
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

1 Answer 1

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
share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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