I was kind of innocent when I wrote the dynamic signatures guide, as a response of a forum question. I could never imagine the success of this guide. I'm sure it is one of the most important factors contributing to this site's page rank. Nothing spectacular, but given that the community activity here is not very high, I believe I can feel quite happy with it.
If you tried to search for "dynamic signatures" (I guess this is a competitive enough combination of words) at Google, Yahoo! or MSN, you ended up finding that little guide, close to the top of the list. At this time, it seems Yahoo! and MSN have noticed the change, however, this is not the case with Google.
I'm very happy to think it has been of some help for one or two out there. However, I moved the guide here from my old website. The URL (and even the domain) is now different. How could I tell Google about this change?
Actually, I have a little problem with this guide that I'm planning to solve using a mod_rewrite trick. What I'll try to do is tell everyone that what it was there, it is now here. In other words, I need to generate a permanent redirection from the old URL to the new one. In HTTP terms, I need to generate a 301 error... and well, hope that Google (and everyone else, of course) takes this into account. :-)
The first thing that comes to mind, is to try it with the Redirect permanent directive. However, it doesn't seem to work, I think it is because the original URL uses parameters (a query string). So something like the following is discarded.
Redirect permanent /phpBB2/viewtopic.php?t=308 http://www.phpmix.org/how_to_create_a_dynamic_signature
Let's see with mod_rewrite then...
I would like to mention that there were several URLs pointing to the same content. It was a phpBB topic, that is, the following URLs were practically equivalent:
http://www.example.com/phpBB2/viewtopic.php?t=328 (the topic itself)
http://www.example.com/phpBB2/viewtopic.php?p=1026 (and the post)
This is what I tried next:
RewriteCond %{REQUEST_URI} ^/phpBB2/viewtopic.php$
RewriteCond %{QUERY_STRING} t=328 [OR]
RewriteCond %{QUERY_STRING} p=1026
RewriteRule (.*) http://www.phpmix.org/how_to_create_a_dynamic_signature? [L,R=301]
The first condition matches the requested file (phpBB2/viewtopic.php). Note that any of the 2nd and 3rd conditions should also match (thanks to the OR keyword). In pseudocode it would look something like this:
IF REQUEST_URI = 'phpBB2/viewtopic.php' AND
( QUERY_STRING = 't=328' OR
QUERY_STRING = 'p=1026' )
THEN
Redirect permanent to new URL
ENDIF
There is a couple of things in the RewriteRule line I would like to mention too. The first one is the question mark at the end of the URL. I had to research a bit until I found it. If not used, for some reason, mod_rewrite was appending the original query string to the resulting URL. The second comment is related to the last argument (R=301). It is often used [L,R] to tell the user agent to rewrite the URL in the address bar, however that does not generate a 301 error, which is what I believe search engines would need to understand that the original content is now here.
Let's see how many time it takes to get rid of the old references. :-/
Update: Yep, it looks like it worked!










Recent comments
1 year 33 weeks ago
1 year 36 weeks ago
1 year 36 weeks ago
1 year 37 weeks ago
1 year 38 weeks ago
1 year 38 weeks ago
1 year 41 weeks ago
1 year 41 weeks ago
1 year 43 weeks ago
1 year 44 weeks ago