How can I mask so all instances of www.oldsite.com are replaced with www.newsite.com
example:
I'd like to replace: http://www.oldsite.com/home/b.jsp?id=9912&ln=115-991632
with www.newsite.com/home/b.jsp?id=9912&ln=115-991632
How can I mask so all instances of www.oldsite.com are replaced with www.newsite.com
example:
I'd like to replace: http://www.oldsite.com/home/b.jsp?id=9912&ln=115-991632
with www.newsite.com/home/b.jsp?id=9912&ln=115-991632
You can do this in Apache with the Redirect directive:
<VirtualHost *:80>
ServerName www.oldsite.com
Redirect permanent /home/ http://www.newsite.com/home/
</VirtualHost>
Well, if you only want to replace that page, you can create a .htaccess file with this content:
Redirect 301 /b.jsp?id=9912&ln=115-991632 http://www.newsite.com/home/b.jsp?id=9912&ln=115-991632
That's all I can think now. You should upload it to your /home directory.
Try this one:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
If you want to do at the application level, just print a location header:
#!/bin/bash
echo 'Location: http://www.newsite.com'
To make it even better, you can place that cgi script at "home" (replace the directory with a script) and use the $PATH_INFO variable to do the correct thing
#!/bin/bash
echo 'Location: http://www.newsite.com/$PATH_INFO'