views:

45

answers:

2

Hi,

Here is my setup :

I have a website located at www.cabsh.org/drupal

I want to use mod_rewrite to do 2 things :

  1. Redirect www.cabsh.org to http://www.cabsh.org/drupal/index.php (I got this one)
  2. Rewrite /www.cabsh.org/drupal/index.php to www.cabsh.org/site/index.php

I cannot figure how to achieve the 2nd point. I'm using .htaccess files since I cannot use the main server configuration. Can anyone help me getting this to work?

Thanks!

A: 

From what I get from your comment, you just want something like this:

RewriteEngine on

# Prevent a request directly to the /drupal folder
RewriteCond %{THE_REQUEST} ^[A-Z]+\s/drupal/
RewriteRule ^drupal/(.*)$ /site/$1 [R=301,L]

# Change a request for /site/(anything) to /drupal/(anything)
RewriteRule ^site/(.*)$ /drupal/$1

Be careful though, since Drupal (being in the Drupal folder) might generate links that point to /drupal instead of /site, which is seemingly not what you want.

Tim Stone
A: 

I'll try that right away!

Yan Hudon