Revenue Source

Welcome to the Revenue Source affiliate marketing forums.

You are viewing our internet marketing and SEO forums as a guest which gives you limited access to most of our discussions.  By joining our free community, you will have access to post affiliate marketing topics, communicate privately with other members (PM), exchange SEO strategies, and access many other special features.  Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems, please don't hesitate to contact us.

Go Back   Revenue Source > Affiliate Marketing Hangout > Internet Marketing Articles > SEO / SEM
Reload this Page HTACCESS Code (General Purpose)
Tags: , , ,

Reply
 
LinkBack Thread Tools Search this Thread
Old
  (#1 (permalink))
SEO Blogs is Offline
Revenue Source Veteran
SEO Blogs is worth a listen.SEO Blogs is worth a listen.SEO Blogs is worth a listen.
 
SEO Blogs's Avatar
 
Join Date: Jul 2005
Posts: 824
   
HTACCESS Code (General Purpose) - 11-15-2006

This is basically what I use to manage dynamic URLs.
  • RewriteCond %{QUERY_STRING} ^(.+)$ [NC] RewriteRule ^(.*)$ - [F,L] Protects against bogus query strings attached to the end of a URL. This code is customized to issue a forbidden instead of a 404.
  • RewriteCond %{REQUEST_URI} ([a-z0-9]+)\.html$ [NC]
    RewriteRule ^([a-z0-9]+)\.html /script.file?p_path=$1 [L] This allows dynamic xyz.html under a directory and block any links to xyz.html%20, xyz.html^20, etc.
  • I can also cover multiple “root files” (urls that are visible to visitors and should not take query strings):
RewriteCond %{QUERY_STRING} ^(.+)$ [NC]
RewriteCond %{REQUEST_URI} ^/dynamicpage1\.html
RewriteCond %{REQUEST_URI} ^/dynamicpage2\.html
RewriteRule ^(.*)$ - [F,L]
  • RewriteRule ^([^/]+)$ http://www.domain.com/path/$1/ [R=301,L] 301 redirect for path without /. I use this in cases where urls end in / (as opposed to say .html). Just a rewrite may work but use this if you’re worried about duplicates.
  • RewriteRule ^([^/]+)/$ /encryptedfile04ha8fksdasd.html?query=$1 [L] This rewrites URL to the actual dynamic URL. The html file name is encrypted to make it difficult to link directly to the actual dynamic page.
Additionally, in rare cases where I can’t catch bad query strings externally or I need to scan query strings for bad query values, I use this PHP 5+ code, where redirectfunction() is a custom function that will generate a 404 page:
foreach($_REQUEST as $key => $value) {
$$key = $value;
if(check for values) redirectfunction();
}
Last thing: In addition to encrypting dynamic pages, you might want to block them via robots.txt to prevent it from getting them indexed. Of course, doing so can expose that url to your competitors, so personally, I would just make sure no internal links point to the actual dynamic page.
More .htaccess / mod_rewrite links:
HTACCESS Code (General Purpose) - Read More...
  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: HTACCESS Code (General Purpose)
Thread Thread Starter Forum Replies Last Post
How many hand-code? How many WYSIWIG? mogrady Goofing Around & Program Discussion 7 11-14-2006 07:31 PM
Russian Jams Way To Google Code Win Affiliate Marketing News Internet Marketing Articles 0 10-31-2006 04:49 AM
New Merchant 11096 - BasicTemplates.BIZ - General Web Services Affiliate Program Affiliate Marketing News New Shareasale Merchants 0 10-17-2006 07:27 PM
Merchant 6273 - Russian Legacy, Inc. - $130.00 off Parade Soviet General visor hat Af Affiliate Marketing News Shareasale Affiliate Deals 0 10-17-2006 07:27 PM
New Poll: Do you hand code or WYSIWYG? mogrady Lightspeed Research 1 02-08-2005 08:34 PM



© 2004-6 RevenueSource.com.  All rights reserved.  Do not duplicate or redistribute in any form.
This website and its logos/design are property of RevenueSource.com.  All rights reserved. vBSEO 3.2.0 RC7


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34