how can i make a rewrite rule to read links on the link bar, if there any???

Discussion in 'PHP' started by free-designer, Jul 21, 2010.

  1. #1
    Hey guys,
    im using .htaccess to rewrite my links to make it pretty.
    on my script i have a submit that read a link on the link bar above for example

    example.com?action=share&url=http://www.google.com/

    I want it to be :

    example.com/share/http://www.google.com/

    i used this rewrite rule

    RewriteRule ^/(.*)/(.*)?$ index.php?action=$1&url=$2 [L]

    when i type in example.com/share/http://www.google.com/ on the urls bar on my browser to test the result i get Error 400 (Bad request).

    What am i missing?
    Thanks so mush
     
    free-designer, Jul 21, 2010 IP
  2. ashishhbti

    ashishhbti Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think your rewrite rule is ok.

    have you added other nessasay lines -

    Options +FollowSymlinks
    RewriteEngine on


    etc.
     
    ashishhbti, Jul 21, 2010 IP
  3. free-designer

    free-designer Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yea everything is well, and i did a research and i find out that, there is no way to type a link inside a link with htaccess, it's only can be made by the regular way whech is ...php?url=blah
    Thanks for help
     
    free-designer, Jul 21, 2010 IP