domain name alias separate html site in sub directory
-
Hello,
I have an issue that has just developed. I hope I can explain it clearly
and that someone may be able to assist or offer suggestions.I have a main domain in this account that points to a wordpress site.
townieoriginal.com & https://www.townieoriginal.com
townieoriginals.com & https://www.townieoriginals.com
towniebug.com & https://www.towniebug.comdirect to:
https://www.townieoriginals.com/The above is correct with no issues.
However, I also have a few domain aliases that are supposed to redirect
to a sub-directory that contain html sites for their respective alias.I previously was using a JavaScript code in the head of my the home page
of the WordPress site and it was working until recently for an unknown reason and I had since removed the coding.I also tired tinkering with the .htaccess site in the root directory of
the site, but am not proficient with the .htaccess coding. I also tried
to find a WordPress plugin for this without luck (came close but not for this particular scenario).I am to try and achieve the domain alias redirect as explained below:
*****
townieink.com & https://www.townieink.com
townieplacemats.com & townieplacemats.comshould redirect to:
https://www.townieink.com/townieink/payment.htm
*****and
*****
antoniosnewbedford.com & https://www.antoniosnewbedford.com
should redirect to:
https://www.antoniosnewbedford.com/antoniosnewbedford/*****
I’ve spent several hour searching for a solution and wonder if you may
have recommendations.Thanks,
JacquieThe mentioned javascript code (no longer working) is:
`<script language = “JavaScript”>
<!–
//***** Name this script “index.html”
var requestedDomainObj = document.URL;
var requestedDomain = requestedDomainObj.toLowerCase();
var sendToLocation = “”;
var gotMatch = false;
var siteToCheckFor = “”;
siteToCheckFor = /townieink.com/;
if ((siteToCheckFor.test(requestedDomain)) && (gotMatch == false)) {
sendToLocation = “https://www.townieink.com/townieink/payment.htm” ;
gotMatch = true;
}
siteToCheckFor = /www.towniink.com/;
if ((siteToCheckFor.test(requestedDomain)) && (gotMatch == false)) {
sendToLocation = “https://www.townieink.com/townieink/payment.htm” ;
gotMatch = true;
}
siteToCheckFor = /townieplacemats.com/;
if ((siteToCheckFor.test(requestedDomain)) && (gotMatch == false)) {
sendToLocation = “https://www.townieink.com/townieink/payment.htm” ;
gotMatch = true;
}
siteToCheckFor = /www.townieplacemats.com/;
if ((siteToCheckFor.test(requestedDomain)) && (gotMatch == false)) {
sendToLocation = “https://www.townieink.com/townieink/payment.htm” ;
gotMatch = true;
}
siteToCheckFor = /antoniosnewbedford.com/;
if ((siteToCheckFor.test(requestedDomain)) && (gotMatch == false)) {
sendToLocation =
“https://www.antoniosnewbedford.com/antoniosnewbedford/” ;
gotMatch = true;
}
siteToCheckFor = /www.antoniosnewbedford.com/;
if ((siteToCheckFor.test(requestedDomain)) && (gotMatch == false)) {
sendToLocation =
“https://www.antoniosnewbedford.com/antoniosnewbedford/” ;
gotMatch = true;
}
if (gotMatch == false) {
sendToLocation = “/”;
}if (sendToLocation != “/”) {
window.location=sendToLocation;
}
//–>
</script>
- The topic ‘domain name alias separate html site in sub directory’ is closed to new replies.