Hide servers real URL?....how?

New to mod_rewrite? This is a good place to start.

Postby Guest » Fri Nov 23, 2001 6:44 am

Hi
I have a site http://www.siteA.com/dirname/ which is to be redirected (via redirection) to http://<IPnumber>/ but still appear to the browser to be accessing http://www.SiteA.com/dirname/
Could someone help me please as I am a complete novice with mod_rewite I'm afraid :sad:
dUb
Guest
 

Postby Brett » Sun Nov 25, 2001 7:56 pm

Hi dUb,

If you use redirection, the new URL is likely to appear in the browser window, but you can accomplish it by including the following in your .htaccess file:
RewriteEngine on
RewriteRule ^dirname/(.*)$ http://<IPnumber>/$1 [R]


Another way, which is not really a redirect but which will hide the new URL, is to make a PHP file, redirect.php, containing the following code:
<?php
readfile ("http://<IPnumber>/$QUERY_STRING");
?>


Then include the following in your .htaccess file:
RewriteEngine on
RewriteRule ^dirname/(.*)$ redirect.php?$1


This thread is a related topic.

<font size=-1>[ This Message was edited by: Brett on 2001-11-25 22:57 ]</font>
Brett
 
Posts: 82
Joined: Tue Jul 10, 2001 4:00 pm
Location: yohost.com

Dynamic Pages Masking Url

Postby SmokeyMcPot » Fri Jan 09, 2004 9:50 am

i have a similar problem only i have a domain name www.testuser.com and i want to redirect that to a dynamic location

http://www.testserver.com/opencms/openc ... /index.jsp

but still keep the same domain name (www.testuser.com) visible in the address bar.

Have you got any idea's how i could accomplish this.


Thanks for any help
Brad
SmokeyMcPot
 


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 53 guests

cron