Redirecting URL w/ no change in address bar

Discussion in 'Apache' started by hovesh07, May 14, 2008.

  1. #1
    hovesh07, May 14, 2008 IP
  2. hbeaver

    hbeaver Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mod_rewrite will take your pretty url and send it to your server as a query string (assuming it is configured properly). So, if you type in the url with the query string it will still be displayed with the query string. However, if you type in the pretty url it will display as such in the browser. This means you chould change all of the link in your site to use your pretty url and it should work just as you want.
     
    hbeaver, Jul 10, 2008 IP
  3. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #3
    If you pasted your exact .htacess rewriterule then yes, you are doing it wrong... it shouldn't redirect to your real address, it should stay the same as you typed it in your browser. I think you are missing [L] at the end of that line. So it should look like this:

    RewriteRule ^products/([0-9][0-9])/$ /productinfo.php?prodID=$1 [L]
    Code (markup):
    Oh and by the way... you do know that this rule "([0-9][0-9])" will work only for your products with ID from 10 up to 99 ? It will not match three digit numbers (or larger) and it will not match the products with ID number smaller then 10.
     
    pr0t0n, Jul 11, 2008 IP
  4. Yousif

    Yousif Banned

    Messages:
    233
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    OR, you can go the easy route and make an iFrame to the size of your choice, it does the trick, lol.
     
    Yousif, Jul 12, 2008 IP