Archive for the 'Programming' Category

Redirect Single Page for Search Engine Query

Sunday, September 10th, 2006

If you're new here, you may want to subscribe to my RSS feed. Read my top posts or learn more about Michael Gray. Want more frequent updates follow me on Twitter. Thanks for visiting!

So if anyone reading this is an htaccess expert and can give a me a little help I’d appreciate it. I’m looking to trap for queries for a specific term from a search engine for a specific page and redirect them elsewhere. For example:

if the query was

http://www.google.com/search?q=foo*

and it went to

http://www.wolf-howl.com/foo/

I’d like to redirect to

http://example.com/foo/

for people who come to the page any other way I’d still like to show them

http://www.wolf-howl.com/foo/

Sphere It

Htaccess %3F Rewrite

Tuesday, May 23rd, 2006

All right I’ve looked around can’t seem to find the answer, so hopefully one of my nice readers knows the answer and will share. I’m getting a bunch of inbound links that look like this

http://www.wolf-howl.com/%3Fp=324
http://www.wolf-howl.com/%3Fp=325
http://www.wolf-howl.com/%3Fp=326

%3F is the URLencoded character for a [?]. I could do something manual but I’m looking for a slicker more programatic way to rewrite the %3f character to a ? and keep the remaining query string intact.

Sphere It

Wordpress 2.0 Permalinks, Error Codes, and Google Sitemaps

Saturday, May 6th, 2006

So I’m working on using Wordpress as a CMS for a “static looking” site and so far I’m pretty happy (get the static front page plugin it saves oodles of time). I’ve learned to keep my hacks in the templates and out of the “program files”. I’ve also moved to using permalinks and have the structure set to this Wordpress 2.0 Permalinks, Error Codes, and Google Sitemaps »

Sphere It

Contact Form Exploits

Saturday, February 11th, 2006

I’m currently having a major battle with one of my hosting companines about an exploit someone is running against a contact form on one of my sites (more about that another time). However I’m a firm believer in contact forms because they would be something people would look for to get a sense of trust in a website (see Google Trust and Librarians). Anyway if you run contact forms and scripts it may be worth taking a look at them, here’s a page with some tips for helping you protect yourself.

Sphere It

Protopage

Wednesday, December 28th, 2005

Protopage is a really neat ajax-style web 2.0 internet based desktop. It is fully configurable page with sticky notes, personalized news, RSS Updates, and bookmarks. A really neat thing it does is let you set up multiple pages, so you could categorize things. However I worry about getting too attached to things like this that are free. What happens if the company can’t find a way to stay profitable and goes belly up? Sure i could pull my data off but gosh what a drag. I guess I’m really going to have to get a wiki running on my development server. Integrating an RSS reader into it somehow would really be golden.

Sphere It

Wordpress, How Many Days Old is the Post

Wednesday, December 14th, 2005

Over on Performancing.com Andy, says the money is in the archives, stupid. Nick talks about Monetizing your Blog, by showing different levels of advertising based on how old post is and whether someone is logged in or not. Now Andy’s doing a blog monetization makeover, and time sensitive ads came up again. Since I’ve got the hood open on this WordPress install I figured I would work up some code to figure out how old a post is. Wordpress, How Many Days Old is the Post »

Sphere It

Add to Del.icio.us JavaScript

Thursday, August 25th, 2005

Get a better social bookmarking script here at Social Bookmark Scripts & Widgets

If you run a blog, forum, news website, or anything other kind of website that you want people to add to their del.icio.us bookmarks, feel free to grab my Add to Del.icio.us JavaScript. It’s a nice simple little piece of code that gets the URL and title of the page and builds it to the post URL. I chose JavaScript so you could use it on HTML pages as well as PHP, ASP, or any other language. Use it, let me know what you think, or if you have ideas to improve it.

Categories:( | | | )

Sphere It

Blogging Tip : Permalink

Sunday, August 21st, 2005

If you write a blog or read them regularly chances are you come across the term permalink. A permalink is supposed to do two things:

So most blogs have permalink or similar concept, which is a good thing. The problem however lies in the implementation. Many blogging software packages (including Google’s blogger) use the [#] character or the word [permalink] as the anchor text for the ‘cool URI’ or link to the individual post. While not the worst thing you could possible choose, both are incredible horrible choices. What you’ve done is dilute your internal anchor text. Anchor text is used by search engine algorithm’s to determine what a page is about, so if you have one link with [post title] and another with [permalink], you’ve opened up the door for search engine confusion. To make matters worse, the more you post the more confusion you create. If you made 1 post a day for a year you have 365 internal anchor links for the term [permalink] and all pointing to different pages.

You can fix the problem pretty easily without destroying the concept. Take the word [permalink] make it normal non linked text, then right next to it change the anchor text for the link to the actual title of the post. If I lost you look down below to where it says permalink for an example. Got it … good.

Categories:( | | | | | | )

Sphere It