NYCPHP Meetup

NYPHP.org

[nycphp-talk] [OT] Apache Testing Server Config Problem / Mod_Rewrite?

jessica kelly jkelly at sussex.edu
Thu Feb 17 17:25:11 EST 2005


Hi All,

I'm upgrading all of my server software and need to test out before the upgrade. I'm using the ApacheFriends xampp for windoz package.

I whish to fully test out my current online site on the test server so I know all php, perl, mysql scripts and related webpages will work properly.

Problem: I have some includes and hard coded links in the site. This causes the browser to resolve to the online server rather than the test server when using the dropdown (javascript) menues etc..

I have been looking, trying to configure mod_rewrite all day to do this:

When you see mysite.com/bla/bla/bla.htm in the 
page (server is parsing all pages) change the mysite.com part to 127.0.0.1 so the browser will navigate properly down the directory tree. 

This is what I have in the htaccess file in the webroot folder:
RewriteEngine on 

RewriteCond %{HTTP_HOST}   !^mysite\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)         127\.0\.0\.1/$1 [L,R]

Can someone point me in the right direction or offer an outright rule/fix that will do this. I've been all over the mod-rewrite.com site and google and do not see any examples of what I'm trying to do.

Thank You,

Jessica



More information about the talk mailing list