superfrog
02-05-2004, 09:39 AM
I have a domain eg. mydomain.com and bought another eg. mydomains.com.
Is there anyway i can map mydomains.com to mydomain.com such that if anyone types:
mydomains.com/something/blar.php, it will redirect to: mydomain.com/something/blar.php
is this possible?
If you want the actual domain to change, not just share the same content the easiest way would likely be .htaccess. If you have cpanel as your hosting control panel you can create this with the redirection option in cpanel.
Or you could created a file in your web directory called
.htaccess and add the following:
RedirectMatch mydomains.com/something/blar.php mydomain.com/something/blar.php
All on the same line with a space between the two domains.
Do you want it to redirect, or only show the same pages?
If you want both domains to show same content, you can
add a parked domain.
If you need forewarding, a little php or perl script
would be a good solution.
Feel free to message me if you need a script for that. It`s
only a few lines, and I could write one for you for free.
Ops, SRLHosting you beat me to it :)
Not quite, different solutions. ;)
Yes. Your solutions sound better. I just made up a solution with the perl script that would require nothing else from server than perl or php access. Also thought he wanted a generic solution for all domains. Probably that can also be done using .htaccess ?
superfrog
02-05-2004, 10:18 PM
I am looking for one that will forward one domain to another.
If i use .htaccess, do I have to create entries for each URL I want to forward? As there will be a forum, blog.
thanks
.htaccess does support wildcards, so you may be able to work something out with that.
Here is a link to some .htaccess tips. http://www.javascriptkit.com/howto/htaccess.shtml
superfrog
02-05-2004, 10:42 PM
Originally posted by SRLHosting
.htaccess does support wildcards, so you may be able to work something out with that.
Here is a link to some .htaccess tips. http://www.javascriptkit.com/howto/htaccess.shtml
thanks for the link. Great tut about .htaccess.
thank you. :)
Brightadmin
02-06-2004, 06:42 AM
Hi,
Write a redirection in .htaccess file as follows.
redirect permanent /something/blar.php
mydomain.com/something/blar.php
So, that if you give this URL mydomains.com/something/blar.php, it will automatically redirect to mydomain.com/something/blar.php
Regards.