haris,
You can use mod_rewrite to examine Apache's {REMOTE_ADDR} variable and make a redirection based on that.
I'm sure that there must be something else in your question, though, that I'm not sure can be accounted for with mod_rewrite's redirection although I can't imagine what it might be. Just pop the mod_rewrite code into your .htaccess file in the DocumentRoot (of the domain) and that should be it. Try:
Code:
RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^123\.123\.123\.123$ # Your IP address - I hope you have a fixed IP address
RewriteRule .? dev%{REQUEST_URI} [L]
NOTA BENE: This will fall over if live is the DocumentRoot because dev is outside your webspace - move dev under live and alter the RewriteRule regex to !^dev/.
Regards,
DK
Bookmarks