Changing pagenames

Discussion in 'PHP' started by fatabbot, Jul 20, 2006.

  1. #1
    Good day,


    I have a php page pagex.php which needs the url parameter ID.
    So there are like 200 totally different pages pagex.php

    pagex.php?id=1
    pagex.php?id=2
    ...
    pagex.php?id=200

    For the surfer i do not want to show that url. Instead i want to show for example blue_jeans.html instead of pagex.php?id=5 ...
    Not only because that looks better, but also to make the page more relevant for google adsense.
    Is this possible?
     
    fatabbot, Jul 20, 2006 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,824
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #2
    You would need to have alongside each of the articles in your database a unique "short name" eg "blue_jeans" so that the system can search for the article by that name.

    Wordpress take a different approach that may be more flexible. I'm able to setup my links to look like

    vbulletins-inbuilt-rss-feeds/248/

    which gives me some nice text in the name and includes the id. When the .htaccess gets the request it's the id which is used.

    How you formulate them is up to you.

    You may wish to have
    /blue_jeans_123.html
    /123/blue_jeans.html

    or any other combination. Either way it'll do the trick.

    Read other posts in the forum for how to setup your .htaccess so that all pages can conform to a "pattern" to create a quick an simple file.
     
    sarahk, Jul 20, 2006 IP
  3. fatabbot

    fatabbot Well-Known Member

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    138
    #3
    I can find some info about permalink, but isnt that for blogs only ?
     
    fatabbot, Jul 20, 2006 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,824
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #4
    Permalinks is a buzzword created by bloggers because of the time sensitive nature and their posts were moving around as new content is added.

    The technology and the concept is exactly the same.
     
    sarahk, Jul 20, 2006 IP
  5. fatabbot

    fatabbot Well-Known Member

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    138
    #5
    You know of any good tutorials for setting up htaccess for these purposes?
     
    fatabbot, Jul 20, 2006 IP
  6. sarahk

    sarahk iTamer Staff

    Messages:
    28,824
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #6
    google or search this forum.
     
    sarahk, Jul 20, 2006 IP
  7. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #7
    Hi there. What you're trying to do is "URL Rewrite". This requires Apache to have the module called mod_rewrite installed.

    Guides for doing this:
    For Apache 2.x: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
    For Apache 1.x: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
     
    phper, Jul 20, 2006 IP
  8. fatabbot

    fatabbot Well-Known Member

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    138
    #8
    fatabbot, Jul 21, 2006 IP
  9. sarahk

    sarahk iTamer Staff

    Messages:
    28,824
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #9
    Search engines should always see what people see - otherwise it's cloaking and that's a very bad thing.

    What happens is page_xyz.html is requested, the server says that means page.php?id=xyz and makes a second call.

    It's clean, good and happens everywhere.
     
    sarahk, Jul 21, 2006 IP
  10. fatabbot

    fatabbot Well-Known Member

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    138
    #10
    so that means it has no effect on relevance of google adsense ads?
     
    fatabbot, Jul 21, 2006 IP
  11. sarahk

    sarahk iTamer Staff

    Messages:
    28,824
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #11
    The bot that does adense is different from the googlebot, but neither are affected.
     
    sarahk, Jul 21, 2006 IP
  12. fatabbot

    fatabbot Well-Known Member

    Messages:
    559
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    138
    #12
    Thank you SarahK
     
    fatabbot, Jul 21, 2006 IP