Forum Moderators: phranque

Message Too Old, No Replies

Best format for naming structure

         

ntbgl

4:33 am on Feb 17, 2009 (gmt 0)

10+ Year Member



I'm trying to improve my site's naming structure using an .htaccess rewrite file and PHP.

I'm moving from example.com?var1=m&var2=m,f&var3=san,lax&var4=r,s but which is a better format to move to?

example.com/m/m,f/san,lax/r,s/
example.com/m/mf/sanlax/rs/
example.com/m/m-f/san-lax/r-s/
example.com/m-m,f-san,lax-r,s/
example.com/m,m-f,san-lax,r-s/
example.com/m.m,f.san,lax.r,s/
...

The requests are generated by the site, and not typed in hand by the user, unless they send it out via email or something.

Which one would you use?

ogletree

9:46 pm on Feb 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



First off you can't use commas in url's. Second it is better to try to fit some keywords in there. Remember your url is another line on a search result. Search engine friendly url's won't improve your rank directly but the cleaner your url's look the better chance you have of somebody linking to you with them. Another thing you want to avoid is really long url's. You don't want people using one of those services that shorten your url's when they use them in emails and chat.

phranque

10:22 pm on Feb 19, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



commas are reserved characters in a url and should be encoded.

rocknbil

11:01 pm on Feb 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My two cents, if you're going to do this, make it something meaningful:

example.com/Mary-Frisco-Los-Angeles-Ride-and-Park

My nonsensical URL is an indicator that the URL's you posted are unintelligible. :-) Think user friendly; make it memorable. Think search engines; it should contain keywords relevant to the topic.

Second, I wouldn't use directory structure unless it's absolutely necessary. When you receive the REQUEST_URI, it's much easier to strip off any google tagging, then split the URL on slashes. Your relevant URL is the last parameter, and you can use it to repopulate your input variables as needed.