Help me, please. I can not rewrite my url!

Discussion in 'Apache' started by albertsilva, Mar 5, 2010.

  1. #1
    Hi my friends,
    I have a big problem, I can not solve!
    I have a site in Joomla and I want rewrite the next urls:

    From:
    http://www.mysite.com/index.php?msg=www.msg.com/

    To:
    http://www.mysite.com/msg/

    I can access the url http://www.mysite.com/msg/, but I can not access the URLs that begin with http://www.mysite.com/msg/. Example: http://www.mysite.com/msg/restante-of-urls. I can not put one by one code in .htaccess, they are many urls. I wanted to do this automatically. Just replace index.php?msg=www.msg.com to msg, in all urls.

    My htaccess are this:

    Options +FollowSymLinks
    RewriteEngine On
    RewriteRule ^msg/$ index.php?msg=www.msg.com/ [L]
    Code (markup):
    When I access the address http://www.mysite.com/msg/any-url a error 404 appears.

    Somebody help me, please?


    Sorry for my bad english! I m brazilian... Thanks!!!
     
    Last edited: Mar 5, 2010
    albertsilva, Mar 5, 2010 IP
  2. peterk92

    peterk92 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think something like this should do but this was done by memory so I may be wrong.

    Options +FollowSymLinks
    RewriteEngine On
    RewriteRule ^msg/?([0-9A-Za-z]*)$ index.php?msg=www.msg.com/$1 [L]
    Code (markup):
     
    peterk92, Mar 7, 2010 IP
  3. albertsilva

    albertsilva Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hello peterk92,
    Thank you for your reply. But the code did not work.
    When I try to access the links, all return to the page mysite/msg (index.php?msg=www.msg.com/).

    More any solution?
     
    albertsilva, Mar 7, 2010 IP