Mt. Moon Community

Full Version: Don't use querystrings *revived*
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The other topic died, so I'm restarting it.

I've noticed most of us use the type of PHP includes where we have to type our urls like this:

http://www.sitename.com/index.php?id=page
http://www.sitename.com/?id=page
http://www.sitename.com/?page=page

I'm going to suggest you,DON'T use those type of URL's. Why are reasons you shouldn't use query strings in url's:

Un-Spiderable
Search Engines don't index your pages if you have Querystrings in URL's, because they may be caught in loops. And if they do inde your pages, they only index 2 pages instead of all.
Bad Rankings
They'll give you bad ranking on google and other engines. Meaning, that insted of getting a page rank 4/10, you get 2/10 or zero most of the time.
Hard to guess
People are used to sitename.com/directory/pagename.html, and they have a hard time guessing those manipulated URL's.

Down below are two rewrite rule codes. Paste them into .htaccess file. They work the same, just the first one is for people who like using folders for there files, such as
page.com/lol/xd, and the first is for people who use raw url's like this page.com/lolxd.

Code:
RewriteEngine on
RewriteRule ^([^/]+)/([^/]+)?$ index.php?id=$1/$2

Second One
Code:
RewriteEngine on
RewriteRule ^([^/]+)?$ index.php?id=$1

This way, it makes search engines index your URL's the easier way; by fooling them. Remember, you may still use your original url, and be sure to paste this in between your <head></head> tags:

Code:
<base href="http://www.yourname.com/">

After this, test your URL's, and they should be working! Some hosts don't allow mod_rewrite, or .htaccess files, so be sure to ask if you're planning to use mod_rewrite.
We get your point already.
* Eon-Rider sighs.

No need to blab about it everywhere you go. Toungue
It's not really blabbing, and I only reposted the topic so I won't bump. If you want me to bump the old one with the new codes, then I'll do it to stop the topics. And thank you for not contributing to the topic in any way.
Basically, it's just personal preferance. Query strings are highly searchable, you'll find a lot of my pages in Google, but ranking probably does suffer a bit.

Totally up to the webmaster.
I just do it for neatness, wether or not it is true. And It's been a while ever since I accomplished it.
I might try that for my website, thanks Faltzer! i think it will work (For freewebs?)
if not i tried.
There's no point in trying for FreeWebs since it doesn't support the script it fixes in the first place.
Freewebs doesn't support .htaccess.
Reference URL's