Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect readthedocs web pages to other website

We started having our project's docs on readthedocs site (say http://abc.readthedocs.org). For various reasons we now moved to our own web servers with new domain (http://abc.io).

We want to bring down http://abc.readthedocs.org gracefully so that our project documentation is not broken all across the internet.

One way we are thinking is to have "redirects" from all pages with prefix (http://abc.readthedocs.org) to (http://abc.io).

But, I don't see any redirection options in readthedocs site that provides redirection to completely new domain. Readthedocs only allow redirection within different pages under same domain.

Any pointers on how I can proceed would be very helpful.

like image 206
Sandeep Avatar asked Nov 09 '16 07:11

Sandeep


1 Answers

I added the following section to my index.rst:

.. raw:: html

    <script type="text/javascript">
    if (String(window.location).indexOf("readthedocs") !== -1) {
        window.alert('The documentation has moved. I will redirect you to the new location.');
        window.location.replace('http://cosmo-docs.phys.ethz.ch/cosmoHammer');
    }
    </script>
like image 158
rocksportrocker Avatar answered Jan 03 '23 02:01

rocksportrocker