Results 1 to 2 of 2

Thread: apache rewrite rule help

  1. #1
    Join Date
    Sep 2010
    Posts
    1

    apache rewrite rule help

    Hi there,

    I am desperately looking for some help with apache rewrite.

    I have 2 websites; one in root (/) and the other in a subdirectory (/sub)

    the two site are nearly identical apart from the home page.
    how can I use the home page of the one in the sub directory for the root site and whenever a user click on any other page in the subdirectory ( a part from one! ) get rid of the /sub/ bit and send them to the site on the root?

    I am using drupal , so to set the homepage for the site in the root to point to the one in the subdirectory should be easy; but the problem is that I want to set a rule in the subdirectory to send all the pages from the subdirectory site to be redirected to the "twin" pages in the root site;

    so for example www.mysite.com will go to www.mysite.com/sub/

    but www.mysite.com/sub/page
    will go to www.mysite.com/page;

    but, I need to keep www.mysite.com/sub/a_particular_page to point to www.mysite.com/sub/a_particular_page

    so a part from the home page and the a_particular_page all pages from the subdirectory has to point to the homepage;

    hope this is not too confusing.

    any help is greatly appreciated and thank you in advance!!!

  2. #2
    Join Date
    Feb 2010
    Posts
    471

    Re: apache rewrite rule help

    Basically the thing is that if you are writing www.mysite.com it is going to www.mysite.com/sub/ because you have set the index page there. And now the thing you want to achieve you need to set the index page in the sub directory. I mean give a page name = index.php or index.html in your sub directory. Try to do this for solving your problem.

Similar Threads

  1. Replies: 4
    Last Post: 05-05-2012, 05:59 PM
  2. Help - add policy rule
    By microms in forum Operating Systems
    Replies: 1
    Last Post: 10-12-2011, 11:44 PM
  3. Need help with url rewrite on my website
    By Dakshayani in forum Software Development
    Replies: 5
    Last Post: 29-06-2011, 03:25 AM
  4. 3 Hit rule in Vampire war
    By rafael n in forum Video Games
    Replies: 4
    Last Post: 10-03-2011, 05:58 AM
  5. How to rewrite a disc
    By Tionontati in forum Windows Software
    Replies: 6
    Last Post: 30-05-2010, 12:03 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,260,910.22014 seconds with 16 queries