SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Seo URL

  1. #1
    SitePoint Zealot
    Join Date
    Sep 2008
    Location
    HidePoint
    Posts
    195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Seo URL

    i just wanted to knw how is the SEO URL configured in MVC

    ex:

    http://facebook.com/harshamv

    goes to my facebook page.

    is the key word to be stored in database ?

    and how does the controller recognise that its not a controller but a route to different location

    site.com/login
    site.com/member

    are controllers...

    how can the application make out the difference ?

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I would guess the logic would be something similar to...

    Is 'harshamv' a controller? No? Ok, do we have a user named 'harshamv'? Sure! Display harshamv's profile.

    Otherwise send the user a 404.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2008
    Location
    HidePoint
    Posts
    195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    I would guess the logic would be something similar to...

    Is 'harshamv' a controller? No? Ok, do we have a user named 'harshamv'? Sure! Display harshamv's profile.

    Otherwise send the user a 404.
    I am using say CodeIgnitor or Cakephp. where do i make this check ?
    so will the check be done in the constructor method ?

  4. #4
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I'm not too familiar with those libraries I'm afraid, I guess you would have to provide an alternate route than the default, IIRC, they use domain.com/controller/method .
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    U have to use a router for that, if you are using frameworks both Zend Framework and Cake have functions for routing.

  6. #6
    SitePoint Addict eanimator's Avatar
    Join Date
    Sep 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use Mod Rewrite:

    RewriteRule ^user/(.+).php$ index.php?controller=user&username=$1

    http://www.examplesite.com/user/eanimator.php


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
  •