What are good ways to redirect from one website to another automatically by substituting the domain name but keeping the same extension?
-
I need to be able to set up websites on the fly that have the capability to have users copy/paste something like temporarywebsite.com/article1 or anothertemporarywebsite.com/article1 or smallurl.io/article1 or sitiodewebtemporario.mx/article1 you get the point and be redirected to thetargetwebsite.com/article1 [which will always exists and always be adding new extensions] So I guess on the backend, the temporary website will never really host any active content other than the homepage. It just exists as a redirect. it needs to take in absolutely any extension to its url and then redirect to the intended website. if that extension does not exists on the targeted website, then they just end up at a 404 error page. Ideally if there was a way to proxy so that the site that shows up in a users search history was the temporary site and not the target site. And sorry but I won't respond to "why would you want to do this?" :)
-
Answer:
Use a rewrite engine such as http://httpd.apache.org/docs/current/mod/mod_rewrite.html. You'd put something like the following in your .htaccess file or server config and voila: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.new.com/$1 [R=301,L] This will redirect all traffic on the current server to http://www.new.com, preserving the exact path. You could get fancy and modify the path or only redirect some traffic or whatever else you want. mod_rewrite is rather powerful.
Robert Love at Quora Visit the source
Related Q & A:
- What are good ways to save up for an iPod Touch?Best solution by wikihow.com
- What are good ways to promote my website?Best solution by Yahoo! Answers
- What are good ways to get the "Last Second Bid" on eBay successfully?Best solution by ebay.com
- Can I have my mail forwarded from one yahoo account to another automatically?Best solution by ChaCha
- What are good ways for personal fund raising?Best solution by wiki.answers.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.