Geocities like rewrite - will pay $100

Using mod_rewrite to handle various content issues

Geocities like rewrite - will pay $100

Postby jrianto » Tue Mar 01, 2005 10:59 pm

Hi,
I am starting a free hosting service and would like to use the power of mod_rewrite to add a small frame to the bottom of my members pages.

my members are stored in lettered sub-directories such as:
/var/www/html/a/a...
/var/www/html/C/C...
/var/www/html/8/8...

and so on... what I am trying to do while pulling my hair off for three days now is to rewrite the requested files to

/var/www/html/indexframed.php?file=/a/amemeber/index.html
if the requested file for this example is
http://www.domain.com/a/amember/index.html

How do I do that? Also, how do I restrict to do this rewrite only for HUMANS or browsers, i.e IE, Netscape, Opera, etc, so bots, etc would still be able to spider the members web pages without being redirected to this framed page.

I'm quite devistated to have this work... and are willing to pay $100 for anyone who could help me out with this two tasks by the all-migthy mod_rewrite

If you would like an illustration of how it works, try visiting one of Yahoo Geocities member pages, they always manages to add a frame on the right side of the page.

Please help!

-Jimmy
jrianto
 
Posts: 1
Joined: Tue Mar 01, 2005 10:41 pm

Postby seomike » Wed Mar 02, 2005 8:56 am

Code: Select all
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_USER_AGENT} !^.*googlebot.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} !^.*inktomisearch.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} !^.*slurp.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} !^.*msn.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} !^.*bot.*$
RewriteRule ^([^/]+)/([^/]+)\.html$ /$1/$2/index.html [L]


You'll have to check your logs for the bots that frequent your site.


to add a bot just put this on top of the rewritecond

RewriteCond %{HTTP_USER_AGENT} !^.*NAME OF BOT HERE.*$ [OR]


This will allow the modrewrite for everything but the bots. Ok now the frame issue. It's better to use php to include the frame info or exclude the frame info.
seomike
 
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas


Return to Content

Who is online

Users browsing this forum: No registered users and 10 guests

cron