Mod_Rewrite

Soldato
Joined
2 May 2004
Posts
19,950
Hi,

I've been reading up on and playing with mod_rewrite, making it change e.g. ?id=500 into /id/500/ or ?id=500 into id500.htm.

a lot of sites have said it's a lot better for indexing (Google etc.).

Is this true?

Also, is it all safe aswell?

I've been using this code for .htm rewrite:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule id(.*)\.htm$ /page.php?id=$1

and this one for /id/50/ rewrite:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule page/(.*)/(.*)/$ /page.php?$1=$2

Is that all safe etc.?

Thanks
Craig.
 
Last edited:
Beansprout said:
Google used to ignore any 'id' parameter completely because it was so commonly used for session data. I can't remember if they still do though - but I think they don't.

mod_rewrite is useful because you can put relevant stuff in the URL, like the category, date, title etc. There's little point using it to split up id=x to /id/x imho :)

Will it not help bot indexing to do e.g. page100.html instead of ?id=100 ?

Craig.
 
Back
Top Bottom