Redirect root domain to path

Redirect root domain to path - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Redirect root domain to path error on your web browser. Problem :


Searched all questions by redirect keyword (e.g. 1, 2) but none of them fit my case.



I want to redirect my domain (www.example.com) to another (sub-)domain including path and query if possible:



www.lokki.newdomain.com/resources/index.html?crsource=google&category=web


I do not host second domain website and since that I have no access to its configuration.



My registrar allows setting up domain forwarding but only mirroring one:



example.com/resources/index.html -> newdomain.com/resources/index.html


and I want to set up redirect from my root directly to document.



Is there a way?



UPDATE: having in place AWS instance, what would be the most effortless way of implementing such redirect?


Solution :

You can use a DNS A record to point the domain to the IP address of your Linux instance. Assuming that the instance is running Apache, you would then create a virtual host that does this redirect:



<VirtualHost *:*>
ServerName example.com
RedirectMatch ".*" "https://www.lokki.newdomain.example/resources/index.html?crsource=google&category=web"
</VirtualHost>


You don't say what Linux distribution you are running, so where this configuration needs to go can be a bit different. On Debian based distributions such as Ubuntu or Mint it would go in /etc/apache2/sites-available/example.com.conf then you would use the commands sudo a2ensite example.com and sudo service apache2 reload to enable it and load the configuration into the already running server instance.



Using Nginx, the syntax would be the following, but I'm not sure which file it would go in.



server 
server_name .example.com;
return 301 https://www.lokki.newdomain.example/resources/index.html?crsource=google&category=web;



Cloudflare Webworkers or Nginx reverse proxy redirection could be worth a shot.


We hope that this article has helped you resolve the domains, redirects, domain-registrar error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=