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
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-27989160-1']); _gaq.push(['_trackPageview']); _setCustomVar(1, 'fishfilet', 'tartar', 1); _setCustomVar(2, 'mcdlt', 'mayo', 1);
(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
Twitter:
LinkedIn:
Facebook:
Pingback: Mod_Rewrite for GoDaddy and Wordpress | Ken Shafer's Bloggity-Blog
winsome answers i like it
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…
Ken,
Thanks!
This worked for me!
thanks a lot. it worked perfect. i was having headache due to url rewriting in godaddy.
Ken, thank you. Very helpful.
Ken,
thank you!!!
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.