Home
Home
bigbackground

How to make google friendly url’s

google

Allways wanted to know how you can fix your url’s, when you push vars to it? We all know google don’t like url’s that look like this:

http://www.dotflow.nl/photo.php?album=new&photo=1

Marten from Youngstones gave me a tip about fixing this problem using only the .htaccess file!

Add this to your .htaccess file:

RewriteEngine On
RewriteRule index.html /index.php
RewriteRule (.*)/(.*).html /photo.php?album=$1&photo=$2

Your url now will look like this:

http://www.dotflow.nl/albumname/photoname.html

If you want to keep the photo.php but without .php modify the last line into this:

RewriteRule photo/(.*)/(.*).html /photo.php?album=$1&photo=$2

Your url now will look like this:

www.dotflow.nl/photo/albumname/fotoname.html

2 Comments »

  1. avatar comment-top

    Is it really this easy?? amazing how things so small, have such a big effect!

    comment-bottom
  2. avatar
    cssfriend Says:
    October 1st, 2009 at 17:03
    comment-top

    I was looking for this, ty!

    comment-bottom

RSS feed for comments on this post. TrackBack URL

Leave a comment