I am trying to redirect my addon domain along with custom path to my main domain
here is the script from addon domain's index file:
<script type="text/javascript">
// Javascript URL redirection
var redirect_url = "http://maindomain.com" + location.pathname + location.search;
setTimeout( function() {
window.location = redirect_url;
}, 1000 );
</script>
When I access addon domain without any path, it successfully redirects it to main domain
BUT
When I add custom path, it gives error. How can I redirect it along with customs paths to my main domain?