Help with .htaccess rewrite rule please

Ok I have inherited a drupal based website that serves up different content depending on the url used to access the site.

There is a mobile version accessible at

and then the standard website at

I need to create a redirect rule for the following mobile page to standard page only >

Can somebody please help I have been struggling with this for hours with no luck.


Since you’ve not shown your coding attempt, let me merely say that either mod_alias (Redirect) or mod_rewrite (more powerful but takes a bit more server resources) to:

  1. In the directory (a subdirectory of, use .htaccess with mod_rewrite to check on the {REQUEST_URI} being EXACTLY tour

  2. Redirect to the absolute domain (because you can’t get to the main domain from a subdirectory … or another website [remember, subdomains ARE separate websites]) with the same {REQUEST_URI} string (tour).

Easy peasy!

If you can’t translate that to actual code, have a read of the mod_rewrite tutorial linked in my signature (THEN PM me with your code and I’ll polish it off for you). Alternatively, bring your code back here and have others make suggestions; I’m scarce around here these days so PM is better if you want my comments quickly.



Thanks so much DK for your assistance. However I think my situation is a bit unique the website I am working with uses the drupal domain access module.

The Domain Access project is a suite of modules that provide tools for running a group of affiliated sites from one Drupal installation and a single shared database. The module allows you to share users, content, and configurations across a group of sites such as:

so you see the primary site and the subdomain actually share the same directory. Which is why I am having troubles redirecting from one to the other.

I am basically looking for a rule that I can put on the main htaccess file that says

if accessing redirect to however by you message it sounds like this might simply not be possible?


Au contraire! Use a RewriteCond to test for the (sub) domain then redirect to the (main) domain’s link. Still easy peasy (and it will ONLY redirect’s tour request)!