SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2006
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question [seo url] php scripts vs .htaccess

    I would like to find out...
    Which is the best practice for creating Search Engine Friendsly URL ?

    Modifying php scripts or using .htaccess approach?
    newbie...

  2. #2
    SitePoint Guru risoknop's Avatar
    Join Date
    Feb 2008
    Location
    end($world)
    Posts
    834
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually it's the combination of both:

    You usually use .htaccess to rewrite URLs like this:

    Code:
    www.yourdomain.com?controller=lorem&action=ipsum
    Into something like this:

    Code:
    www.yourdomain.com/lorem/ipsum
    And then, there is usually a routing PHP class which takes care of loading the correct controller class and executing its specified method.

  3. #3
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    BTW, the real term is Human Friendly URLs. Computers (i.e., search engines) could careless, a URI is a URI to them, it returns a resource to be scanned. And the "best" method depends on the structure of the site, the development process, and/or the architecture of the application.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  4. #4
    SitePoint Zealot
    Join Date
    Feb 2006
    Location
    East Yorkshire, UK
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there is alot of tutorials around on the internet and this question has also being asked a fair few times on this forum, try using the search and see what you can pull up some of it may be really helpful

  5. #5
    SitePoint Evangelist
    Join Date
    Aug 2009
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I prefer using .htaccess to rewrite URLa and make them to look friendly
    Daniel, Helpdesk Leader
    Hosting24.com Web Hosting - First class web hosting services.
    Reseller Hosting - Provide unlimited disk space and bandwidth


Bookmarks

Posting Permissions

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