Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2012
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    A problem with .htaccess and a dynamic menu

    Hello again!
    I have a dynamic menu like this:
    ***********
    Teams
    -juventus id_team=1
    -ac milan id_team=2
    -napoli id_team=3
    ..
    ..
    **************
    I have on anchor for every team
    Code:
    <a href="'.$page.'/'.$id_team.'/'.$name.'.html">......</a>
    *****************
    In home page when I access a team I will go in the next page:
    http://127.0.0.1/calcioitalia/teams/2/A.C.%20Milan.html

    And in this page on the dynamic menu I have the next path:
    calcioitalia2/teams/2/teams/3/Napoli.html
    *************************
    So in the next page I have another "teams" and the old id_team (id=2 for AC Milan which was in the home page) and the "teams" and the current id_team (3 for Napoli) and the current name.
    Obviously this page was not found on this server.
    *********
    How could i solve this problem?
    In .htaccess i have:

    Code:
    RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)/([a-zA-Z0-9.\s]+)/?.html$ index.php?page=$1&id_team=$2&name=$3
    Must I change the .htaccess ??
    Thank u very much!
    Last edited by milanello72; 01-01-2013 at 10:11 PM.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Nope, start your links with / that's it. If you don't they go relative to the current path.

  • #3
    New Coder
    Join Date
    Feb 2012
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •