About url rewriting et indexation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zakaria84
Forum Newbie
Posts: 8
Joined: Wed Aug 12, 2009 4:13 pm

About url rewriting et indexation

Post by zakaria84 »

Hi everybody,

I'm developping a mini-social website in PHP.
For each user, a public web page can initially be viewed at
an address like this: http://www.mysocialwebsite.com/index.php?q=username .

So, i would like to know:
- which rules can be used to transform the address http://www.mysocialwebsite.com/index.php?q=username
to http://www.mysocialwebsite.com/username ?

- If it's possible, how Google will index the resulted address http://www.mysocialwebsite.com/username ?
Should i care about indexation?

Thank you.

Regards.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: About url rewriting et indexation

Post by requinix »

It's kinda funny... half of the whole point of doing things like that is so that search engines give you better rankings for smarter-looking links...

You should reconsider using /username as the pattern. What about accounts named "images" or "admin"?
zakaria84
Forum Newbie
Posts: 8
Joined: Wed Aug 12, 2009 4:13 pm

Re: About url rewriting et indexation

Post by zakaria84 »

tasairis wrote:It's kinda funny... half of the whole point of doing things like that is so that search engines give you better rankings for smarter-looking links...

You should reconsider using /username as the pattern. What about accounts named "images" or "admin"?
Thanks for your reply ...

is there another alternative to that?

( I'd like to do like Facebook did recently: all users have a personalized link: http://www.facebook.com/username)

Regards.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: About url rewriting et indexation

Post by requinix »

The other common one is /~username.

For Facebook, what if someone had a username of "pages"?

But whatever.

Code: Select all

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?q=$1
zakaria84
Forum Newbie
Posts: 8
Joined: Wed Aug 12, 2009 4:13 pm

Re: About url rewriting et indexation

Post by zakaria84 »

tasairis wrote:The other common one is /~username.

For Facebook, what if someone had a username of "pages"?

But whatever.

Code: Select all

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?q=$1
Thanks for your quick reply ...
so this piece of code is for the URL Rewriting part.
Can google manage to index the generated url?

Regards.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: About url rewriting et indexation

Post by aceconcepts »

Google will endex whatever shows in the address bar. the rewriting is executed at server level.
zakaria84
Forum Newbie
Posts: 8
Joined: Wed Aug 12, 2009 4:13 pm

Re: About url rewriting et indexation

Post by zakaria84 »

Ok,

i'll try these solutions ...

Thanks again.
Post Reply