Help me in REWRITING the URL

Using a single web hosting account to host multiple sites

Help me in REWRITING the URL

Postby ranjith » Sun Aug 28, 2005 9:48 pm

I have a file aboutus.html in www.domain1.com

I want to access this file from www.domain2.com

While rewriting, the URL in the address bar should be www.domain2.com/aboutus.html.

:confused:
ranjith
 
Posts: 5
Joined: Thu Aug 25, 2005 10:19 pm

Not really possible

Postby jonblock » Sat Apr 15, 2006 6:16 pm

If both domains are *not* hosted on the same server:
- You cannot do this because there is no way to have your web browser location bar show you one address, but fetch a page from another address.

If both domains *are* hosted on the same server:
- Yes, you can set this up as long as both domains can access the file.

Jon Block
mod_rewrite Programmer
http://www.jonathanblock.com/Members/admin/mod_rewrite
jonblock
 
Posts: 15
Joined: Wed Oct 05, 2005 8:11 am
Location: Boston, MA

You can use this for example

Postby softtoy » Tue Jun 13, 2006 2:19 am

I don't know about mod_rewrite but
you could use something like this(php) -->

Code: Select all
<?php
header("Content-type: text/plain");
$fp = fsockopen("www.google.com", 80, $errno, $errstr, 30);
if (!$fp) {
   echo "$errstr ($errno)<br />\n";
} else {
   $out = "GET /search?q=php HTTP/1.0\r\n";
   $out .= "Host: www.google.fi\r\n";
   $out .= "Connection: Close\r\n\r\n";

   fwrite($fp, $out);
   while (!feof($fp)) {
       echo fgets($fp, 128);
   }
   fclose($fp);
}
?>
softtoy
 
Posts: 26
Joined: Mon Jun 12, 2006 9:45 pm

Postby richardk » Tue Jun 13, 2006 7:09 am

If both domains are *not* hosted on the same server:
- You cannot do this because there is no way to have your web browser location bar show you one address, but fetch a page from another address.

Unless you have mod_proxy enabled, then you can use the P flag.

But apparently you can't with SSL (maybe if you have mod_ssl you can): http://forum.modrewrite.com/viewtopic.php?t=1277.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 93 guests

cron