Forum Moderators: coopster

Message Too Old, No Replies

PHP's urlencode() = create friendly URL?

         

tata668

10:17 pm on May 5, 2005 (gmt 0)

10+ Year Member



I use urlencode() to encode my URL that I want friendly to search engines.

The result is something like: http/www.example.com/word1+word2+word3/word4

Is the plus sign "+" a good delimiter for words? Will Google and other search engins see "word1", "word2" and "word3" as separated words? Should I use "-" or "_" instead?

Thanks!

[edited by: pageoneresults at 11:12 pm (utc) on May 5, 2005]
[edit reason] Examplified URI Reference [/edit]

tata668

3:25 am on May 6, 2005 (gmt 0)

10+ Year Member



The thread was moved here but I don't understand why.
My question has nothing to do with PHP really!

killroy

10:05 am on May 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



urlencode() is a PHP function, I supose that is why it was moved.

I believe characters such as "+", "-" or "." are counted as word delimiters while "_" isn't. In other words is you use word1_word2, it will only match a search for "word1_word2".

both "+" and "-" should work fine. "-" usually looks neater, while "+" is a generally used instead of the url encoding of a space "%20" to make it more readable.

SN

tata668

12:48 pm on May 6, 2005 (gmt 0)

10+ Year Member



Thanks!