Is there any way to redirect every pages on a website to another website ?
Actually what I mean is that, I own two websites eg :
- 1.com
- 2.com
2.com is my main website. When I add a page to 2.com (eg:2.com/index.html), 1.com ignores it and creates (1.com/index.html) with the redirecting code to 2.com/index.html.
Can I do this ?
Is there any way to do this by php ?
Actually what I need is a script that automatically create files which are added to my 2nd site on my 1st site. So Can I do this with php and mysql or any other scripting or programming language?
If you own both domains you could just both redirect them to your website using a DNS-A-record or whatever and then simply use a server alias (
Server Alias) as outlined on apache.org. If the user then visits the domain, he will still see the original domain, which he visited.Another way would be using a rewrite rule as described by this blog:
Then your users would always see 1.com in their address bar.