NYCPHP Meetup

NYPHP.org

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

jessica kelly jkelly at sussex.edu
Mon Feb 21 16:53:27 EST 2005


HI Dan,

What a simple solution to my problem. Wish I had asked sooner.

Thanks Again!
Jessica

<<< dcech at phpwerx.net  2/17  6:00p >>>
You could temporarily add an entry to your hosts file that tells your 
machine that mysite.com is 127.0.0.1

On Windows XP the hosts file is:

C:\WINDOWS\system32\drivers\etc\hosts

You will need to open it with your favorite text editor and add a line like:

127.0.0.1    mysite.com

Until you remove that line the system will think that mysite.com is your 
local machine.

Dan

jessica kelly wrote:
> 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
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org

_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org




More information about the talk mailing list