You are here

Clean URL's now on. Omitting /drupal

It wasn't on before because the test failed but I guessed that the problem might be the RewriteBase so checked the root Drupal .htaccess and changed it to /drupal (where Drupal is installed).

When the site goes live we want the urls not to include /drupal. I don't know what the difficulties with that will be.

  • can we just rewite / to point to /drupal?
  • should we work on a parallel website for now and set up another virtual site on the 1and1 host, e.g. and move the drupal directory to its document root. When we want to swap websites we could either change to point to the drupal site or move the files around?



They look a lot neater.

I used the login credentials in twiki to login to the simulistics server to have a look around. Is the httpd.conf file used? If so, how do you restart apache if you change that file?

I'm pretty sure that getting rid of that /drupal in the URL will be easy (it'd be a piece of cake if you had root access) but I don't know how things works on a virtual server.

We can do just about anything .htaccess  files  that we can be done in httpd.conf. There is actually an httpd.conf file in ~/.. but I think it gets overwritten by the control panel when setting up virtual hosts.

(We have ssh access and can do just about anything a non-root unix user can but they don't like you running apps etc from there.)

Encouraged by Mark's comment I had a play in the root .htaccess and added a Rewrite rule to allow access to the blogs without prepending drupal/ :

RewriteEngine on
RewriteBase /drupal
#Rewrite blogs/* to drupal/blogs/*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule  ^(blogs/.*)$ $1

This is mostly pinched from the drupal/.htaccess

so now, if I go to I can see your blogs. Cool. And we should be able to rewrite / to /drupal/ without much fuss.

Will this affect the way links work within drupal at the moment? (e.g. All the links in the nav bar are prepended with /drupal) Will these be updated automatically with the rewrite?


People write about rewriting urls to to another rewritten url and so if we rewrite url based on / to urls based on /drupal the /drupal/* will still exist so nothing should be broken. A downside is the time taken to do all this rewriting but as far as I've read no really seems bothered.

On the other hand we could just move the drupal install to the root directory and rebuild our blog urls etc.

Mark, could you investigate the cost of rewriting?

My guess is that it would be minimal, but I'll look into it.