1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Mod Rewrite - rewrite rule

Discussion in 'Apache' started by Weirfire, Sep 8, 2005.

  1. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #21
    I have no idea how it does that. I've never had that occure to me!!! Though I've always had for example an extension, fake directory, or / in the new URL, not just part of the URL from the script.
     
    Nintendo, Sep 12, 2005 IP
  2. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #22
    I already had the page I wanted to use on the base directory and I was told to keep the pages with the minimum amount of directories so thats why I seem to have programmed it this way.

    I must say it does look pretty tidy this way as well.
     
    Weirfire, Sep 12, 2005 IP
  3. johnt

    johnt Peon

    Messages:
    178
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #23
    If you put the [L] flag onto the end of the RewriteRule it will tell it that this is the last rule to be applied, and it should stop an endless rewrite

    John
     
    johnt, Sep 13, 2005 IP
    dct likes this.
  4. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #24
    Hmmm, I had [R,L]

    Would this make it redirect the URL and start the rewrite again?
     
    Weirfire, Sep 13, 2005 IP
  5. johnt

    johnt Peon

    Messages:
    178
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #25
    Note to self : read the thread before posting :)

    To stop recurrence you could put a RewriteCond in, something like
    RewriteCond %{REQUEST_URI} !page.php
    RewriteRule ^(.*)$ page.php?$1 [R=301,L]
    Code (markup):
     
    johnt, Sep 13, 2005 IP
  6. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #26
    Nice 1

    Thanks for that john :)
     
    Weirfire, Sep 13, 2005 IP