Mod rewrite tips for SEO
One of the bonuses of attending the WMW Pubcon is that they mail attendees a cd of all of the PowerPoint presentations that were used in the sessions. One of the presentations was by a company called TrueLocal, where they discussed using mod rewrite for various things. Now, I do not claim to have much knowledge about mod rewrite, so I cannot explain any of the code they showed us. But, I thought you might like to have the code in case you need it. So, without further explanation, here it is.
Folder move (redirect) - moving a folder from an old location to a new one:
RewriteRule ^olddir/(.*)$ /newdir/$1 [R=301,L]
Serving content transparently - shortening urls for search engines
RewriteRule ^([^/]+)/(.+)$ /file.php?Dir=$1&file=$2 [L]
Deny access to an IP:
RewriteCond %{REMOTE_ADDR} ^123.45.67.[9]$
RewriteRule ^/.* - [F]
Serve Different Content to a UA/IP:
RewriteCond %{HTTP_USER_AGENT} ^Jakebot
RewriteRule ^page1.html$ /special-page.html [F]
Serve Image Based Upon Referrer - Prevent image theft:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !.*/valid-page.htm
RewriteCond %{REQUESTED_FILENAME} ^specific-image-name.jpg$
RewriteRule .*.(gif|png|jpe?g) http://www.example.org/funnypic.jpg
Please make sure you backup your .htaccess file before adding this code to it, in case you need to revert back.
For just a $5 tip, you can advertise your site or affiliate link on SEO Scoop. Find out how.
If you are the first to "discover" any of my posts in StumbleUpon, one of the following categories would probably be the most appropriate to place it into. You don't have to choose one of these, of course, but based on what I usually write about, there's a good chance any of my posts will fall into one of these categories.
Business * Computers * Computer Graphics * Computer Hardware * Computer Security * Databases * Ecommerce * Internet * Internet Tools * Linux/Unix * Marketing * Search * Self Improvement * Web development * Weblogs(Blogs) * Windows * Writing
DazzlinDonna’s take on SEO news, tips and theories.




































