Page 1 of 1

About url rewriting et indexation

Posted: Wed Aug 12, 2009 4:20 pm
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.

Re: About url rewriting et indexation

Posted: Wed Aug 12, 2009 4:56 pm
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"?

Re: About url rewriting et indexation

Posted: Wed Aug 12, 2009 5:01 pm
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.

Re: About url rewriting et indexation

Posted: Wed Aug 12, 2009 5:27 pm
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

Re: About url rewriting et indexation

Posted: Wed Aug 12, 2009 6:09 pm
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.

Re: About url rewriting et indexation

Posted: Wed Aug 12, 2009 6:55 pm
by aceconcepts
Google will endex whatever shows in the address bar. the rewriting is executed at server level.

Re: About url rewriting et indexation

Posted: Wed Aug 12, 2009 7:01 pm
by zakaria84
Ok,

i'll try these solutions ...

Thanks again.