PDA

View Full Version : SE-optimized URLs



James
12-22-2005, 05:03 AM
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 (http://www.websitepublisher.net/article/search_engine_friendly_urls/3) 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?

Masetek
12-22-2005, 06:13 AM
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

Chris
12-22-2005, 07:22 AM
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.

James
12-22-2005, 05:02 PM
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`:D:D :D

organ
01-09-2006, 07:48 AM
Chris,
where is the $PATH_INFO
I have put the '$PATH_INFO" in .htaccess, but could not log in my website

Chris
01-09-2006, 10:24 AM
You're confusing PHP code and what you put in .htaccess. That is PHP code for your php files.

organ
01-09-2006, 07:45 PM
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?

Chris
01-09-2006, 08:28 PM
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.

organ
01-09-2006, 08:40 PM
what your meaning?
Does it just need this script "<Files article>
ForceType application/x-httpd-php
</Files> in .htaccess?

James
01-09-2006, 11:36 PM
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/article/search_engine_friendly_urls/

organ
01-10-2006, 12:50 AM
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/article/search_engine_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

James
01-10-2006, 08:50 AM
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'.

Chris
01-10-2006, 09:13 AM
also a non custom CMS might not take to a friendly URL setup without significant extra work beyond what is mentioned in the article.

organ
01-10-2006, 09:55 PM
yes, I have already give up!
http://www.domain.com/modules/news/article.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.

moonshield
01-11-2006, 05:22 AM
forcetype does not work on some servers, use the following:

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

organ
01-15-2006, 06:58 PM
forcetype does not work on some servers, use the following:

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

Thanks moonshield.
I write a hack to change that CMS.
it not simple, I must change several files and modules.