Seo Url

Discussion in 'PHP' started by turulojko, Jun 19, 2008.

  1. #1
    I need help with doing SEO URLs like:

    test.com/category/this-is-simple-text.html

    I have url like this:
    test.com/showpost.php?cat=4&post=56

    I search the net about this, but all i found is something with .htaccess, and i don't know how to do that.

    Any Help?
     
    turulojko, Jun 19, 2008 IP
  2. coffeesonnow

    coffeesonnow Peon

    Messages:
    34
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    .htaccess is the only way I know. You can use htaccess by just creating a file named .htaccess, then putting the code you found online :)
     
    coffeesonnow, Jun 19, 2008 IP
  3. Dannyboyonline

    Dannyboyonline Active Member

    Messages:
    602
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #3
    I think you need to use mod rewrite
     
    Dannyboyonline, Jun 19, 2008 IP
  4. lwbbs

    lwbbs Well-Known Member

    Messages:
    331
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    108
    #4
    You can refer to Joomla for .htaccess.
    If you want to use PHP to do SEO URL, the format should be
    test.com/index.php/category/this-is-simple-text.html

     
    lwbbs, Jun 19, 2008 IP
  5. andyba

    andyba Well-Known Member

    Messages:
    132
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #5
    in .htaccess you will translate back all test.com/category/this-is-simple-text.html pages to test.com/showpost.php?cat=4&post=56 so that your php code knows what to do with them.
    But before that you have to change your script i.e. add a preg_replace() function for each possible url to change it to something like test.com/category/this-is-simple-text.html inside your script
    It's not so simple so if you don't have experience it's better to find a mod that does it for your forum/site..
     
    andyba, Jun 20, 2008 IP
  6. nastynappy

    nastynappy Banned

    Messages:
    499
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #6
    nastynappy, Jun 20, 2008 IP