GoDaddy .htaccess mod_rewrite is working!!!  

Ok, so I know this is a little out of the blue but a recently acquired SEO client is using GoDaddy for their hosting. Their domain name is something to the effect of www.chicago(businesstype).com. I’ve only been optimizing the site for a couple of weeks and we’re already doing well for keyword phrases using “chicago.”

However, the client wants to attack markets in the surrounding suburbs so I needed to come up with a quick way to create “city pages” for each new market. I did this by using www.domain.com/cityPage.php?city=name. Easy enough…but i needed something friendlier for Google. Enter mod_rewrite for GoDaddy.

I searched around online until I found this combination which works for me.
Original URL: www.domain.com/cityPage.php?city=name (meh)
New URL: www.domain.com/name (wonderful!)

Here’s the magic code!
Options FollowSymLinks
Options -MultiViews
RewriteEngine on
RewriteRule ^([^/.]+)/?$ /cityPage.php?city=$1 [L]

You can see this code working at theĀ Chicago Title Loans site (www.chicagotitleloans.com)

Enjoy!

thx to the following sites for your help!
http://gidden.net/tom/2006/05/26/4/
http://surf11.com/entry/153/godaddy-hosting-mod-rewrite-with-htacces
http://www.btjones.com/2007/12/09/godaddy-mod_rewrite-problem-fix/
http://www.webmasterworld.com/apache/3380566.htm

This entry was posted in Coding and tagged , , . Bookmark the permalink.

8 Responses to GoDaddy .htaccess mod_rewrite is working!!!

  1. Pingback: Mod_Rewrite for GoDaddy and Wordpress | Ken Shafer's Bloggity-Blog

  2. winsome answers i like it

  3. Manoj says:

    I came across the similar situation where i need to know how to run my site like http://www.username.domainname.com which should point to http://www.domainname.com/username/ and so on…

    I tried so many tricks for changing the .htaccess file. Please kindly provide me help… its urgent

    I am also using godaddy control panel…

    thanks…

  4. Ken,
    Thanks!
    This worked for me!

  5. YAMHI says:

    thanks a lot. it worked perfect. i was having headache due to url rewriting in godaddy. :)

  6. John says:

    Ken, thank you. Very helpful.

  7. CC says:

    Thanks so much for figuring this out. I’ve tried many other examples to no avail. This did the trick right away. I don’t know why godaddy has to be so difficult.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam protection by WP Captcha-Free