Rewrite not working

Discussion in 'Apache' started by subnet_rx, Jun 5, 2009.

  1. #1
    I'm not even really sure if rewrite is what I need, but basically I have an alias/proxy setup on apache which points mysite.com/itunes/ to mysite2.com/pr/itunes/. My script php executes on the second server, so it assumes that the address should be mysite.com/pr/itunes/. I need to rewrite this to mysite.com/itunes. Here's my code:

    RewriteEngine on
    RewriteBase /
    RewriteRule ^itunes/(.*)\.php$ pr/itunes/(.*).php
     
    subnet_rx, Jun 5, 2009 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    Not and expert with this but shouldnt the code be like

    RewriteEngine on
    RewriteBase /
    RewriteRule ^itunes/(.*)\.php$ pr/itunes/$1.php
     
    Bohra, Jun 6, 2009 IP
  3. subnet_rx

    subnet_rx Well-Known Member

    Messages:
    141
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    138
    #3
    Yeah, that didn't work either. Like I said, it could be the fact that it's pulling the url from the header, so apache doesn't have a chance to rewrite it. I'm not sure.
     
    subnet_rx, Jun 8, 2009 IP