Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: SE-optimized URLs

  1. #1
    I'm the oogie boogie man! James's Avatar
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    1,566

    SE-optimized URLs

    Okay, so I've coded up a CMS I'm planning to use on one of my sites.
    I'm trying to get it SEO'ed up, so I'm following Chris' Search Engine Friendly URLs article.

    For some reason, though, my ForceType Directive isn't working. I have changed 'articles' to the name of my PHP file. Can anyone think of any possible reason why this wouldn't work and how to remedy it?

  2. #2
    Working. Masetek's Avatar
    Join Date
    Aug 2005
    Location
    Aust
    Posts
    543
    Does it work without forcetype? ie:

    site.com/articles.php/blah/12/

    Personally, I use mod_rewrite instead now

    and just have it convert articles/thisarticles.html to index.php?article=3456
    Last edited by dpmmedia; 12-22-2005 at 06:16 AM.

  3. #3
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Add this to your .htaccess

    AcceptPathInfo on

    Apache 2.0 turns PathInfo off by default, so this turns it back on, its something I need to add when I update the article.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  4. #4
    I'm the oogie boogie man! James's Avatar
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    1,566
    Oh I see!
    For some reason I skipped over the "The ForceType directive allows you to override any default mime types you have set up. Usually it may be used to parse an html page as php or something similar, but in this case we will be using it to parse a file with no extension as php." part every time I read through the instructions.

    Works greatz0r3e!!!Zzz!~! kthxbie!!11!111`
    Last edited by James; 12-22-2005 at 05:03 PM. Reason: I had written "Works great! thanks." As we all know, that's bad grammar.

  5. #5
    Registered organ's Avatar
    Join Date
    Dec 2005
    Posts
    81
    Chris,
    where is the $PATH_INFO
    I have put the '$PATH_INFO" in .htaccess, but could not log in my website

  6. #6
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    You're confusing PHP code and what you put in .htaccess. That is PHP code for your php files.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  7. #7
    Registered organ's Avatar
    Join Date
    Dec 2005
    Posts
    81
    Quote Originally Posted by Chris
    You're confusing PHP code and what you put in .htaccess. That is PHP code for your php files.
    what php files? There are so many .php extension in root directory.
    following your ForceType Directive,
    I put this script "<Files article>
    ForceType application/x-httpd-php
    </Files>
    $var_array = explode("/",$PATH_INFO);
    $var_array[0] //article.php $var_array[1] //999 $var_array[2] //12"
    Can you give me all the details step by step?

  8. #8
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    I get the impression that you do not have a firm grasp of programming concepts and php.

    You're definitely reading the article wrong, part of what you posted is for .htaccess, the other part explains how to extract the variables within PHP.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  9. #9
    Registered organ's Avatar
    Join Date
    Dec 2005
    Posts
    81
    what your meaning?
    Does it just need this script "<Files article>
    ForceType application/x-httpd-php
    </Files> in .htaccess?

  10. #10
    I'm the oogie boogie man! James's Avatar
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    1,566
    Yes, but you also need something in the PHP file (renamed to 'article' without .php on the end) like chris has in the grey boxes on
    http://www.websitepublisher.net/arti...friendly_urls/

  11. #11
    Registered organ's Avatar
    Join Date
    Dec 2005
    Posts
    81
    Quote Originally Posted by James
    Yes, but you also need something in the PHP file (renamed to 'article' without .php on the end) like chris has in the grey boxes on
    http://www.websitepublisher.net/arti...friendly_urls/
    I see and do it, but isn't working.
    BTW, I use "xoop"CMS.
    Apache 1.3
    the URL like that http://www.domain.com/modules/news/
    where is the directory 'article' put?
    I put the 'article' and .htaccess in root

  12. #12
    I'm the oogie boogie man! James's Avatar
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    1,566
    Oh, I see. You seem to have misunderstood: 'article' is just an exampe file name. In your case, you would put 'modules' in your .htaccess and rename modules.php to just 'modules'.

  13. #13
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    also a non custom CMS might not take to a friendly URL setup without significant extra work beyond what is mentioned in the article.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  14. #14
    Registered organ's Avatar
    Join Date
    Dec 2005
    Posts
    81
    yes, I have already give up!
    http://www.domain.com/modules/news/a....php?storyid=9
    the key is article.
    I do it, but isn't working.
    The problem is the .htaccess, it not accept "forcetype"
    I only can use cpanel control it.
    Thank Chris and Jame.

    I think vBulletin archive instead of it is a good choice.
    Last edited by organ; 01-10-2006 at 10:03 PM.

  15. #15
    Registered Member moonshield's Avatar
    Join Date
    Aug 2004
    Location
    Charlotte
    Posts
    1,281
    forcetype does not work on some servers, use the following:

    <Files FILENAME>
    SetHandler application/x-httpd-php
    ForceType application/x-httpd-php
    </Files>

Similar Threads

  1. Replies: 6
    Last Post: 03-20-2011, 09:15 AM
  2. Hyphens in URLs
    By chromate in forum Search Engine Optimization
    Replies: 18
    Last Post: 04-02-2004, 11:46 AM
  3. Search Engine friendly urls ?
    By Dan in forum Search Engine Optimization
    Replies: 6
    Last Post: 02-11-2004, 06:26 PM
  4. Search Engine Friendly URLS
    By dolphin in forum Search Engine Optimization
    Replies: 8
    Last Post: 12-01-2003, 09:01 PM
  5. URL's with spaces in variable values
    By chromate in forum Search Engine Optimization
    Replies: 8
    Last Post: 10-16-2003, 04:04 PM

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
  •