.htaccess tutorial

htaccess Elite


(Website Link) IP Based Redirection

Anything not fitting into other categories

(Website Link) IP Based Redirection

Postby mcconvilletony » 27 Jul 2008 17:11

My web server currently runs Apache 2.0. What I would like to do is to direct certain visitors to my website to slightly altered pages which have different content from what a standard visitor would see.
For example, if everyone clicks on the "WhatWeDo" button, they will be presented with the whatwedo.html page, however if a visitor is from a specific IP address, then I would like to transparently direct them to whatwedo2.html, which will have a slightly different version of the page content.
As I am new to Linux and all of this stuff I am having some problems. Is it correct that I need a .htaccess file to implement this?
I have been playing with the following .htaccess code:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} 1\.1\.1\.1 [OR]

RewriteCond %{REQUEST_URI} /sub_dir1/index/.html$
RewriteRule .* /sub_dir2/index.html [R=301,L]

Is this code even close to what I am trying to do?
Also can someone confirm for me how exactly to go about uploading a file from my Windows Documents folder to the Apache server as I am unsure of the code involved here.
I have read that the mod_rewrite module needs to be enabled to allow this using a .php file. I am pretty sure this is enabled however when I have tried accessing the link from various IPs I am getting various error messages (can't remember what they are right now).

Again I am new to all off this so any help would be greatly appreciated.

Thanks
mcconvilletony
 
Posts: 3
Joined: 27 Jul 2008 16:54

Re: (Website Link) IP Based Redirection

Postby mcconvilletony » 28 Jul 2008 20:38

Anyone? I really need a solution to this ASAP.
mcconvilletony
 
Posts: 3
Joined: 27 Jul 2008 16:54

Re: (Website Link) IP Based Redirection

Postby benicemi » 05 Dec 2009 16:49

Actually, I haven't experienced that scenario before, I just wanted to tell you that you need to go to some php tutorial or some script tutorial website to search some related scenario on your problem. There are many tutorial websites that could really help you on your script. Just Google them.


:)
benicemi
 
Posts: 1
Joined: 05 Dec 2009 10:42


Return to Main