Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Why my new website domain sometimes directed me to the old webpage

YuPi

New Coder
I have a website that was hosted in n*agahoster, which already expired (with active status) since our company didn't want to use the domain example.com and instead change the hosting place to a government's server which resulting to a new domain example.gov.xx

The procedure was not hard, since there is someone who handle the server, and I just gave the backup files (the public_html as well as the database) from old hosting place. Everything went smoothly, until I tried to access the new domain (example.gov.xx), instead of showing me the actual webpage, it directed me to old domain (example.com) which already expired and can't be access. This only happened on a certain time though, if I keep refreshing the web, using different browser, or try to access it later, it will show the correct domain as well as the webpage, BUT it only appeared in my own PC, and if my friends want to access the new domain (example.gov.xx) it will still direct them to the old webpage (example.com) and they have to keep on trying or use different browser, to actually access the correct new domain.

Why can this happen? I already change the link of the old domain to the new domain in my index.php file. Is there anything that I should add or change? Is it the .htaccess file?

v3/index.php
PHP:
<script>

     setTimeout(function(){

       window.location.href = 'http://example.gov.xx/v3/public/'; //The old one is example.com/v3/public

       // window.location.href = 'http://localhost/folder/v3/public/?SI-xxxxxxxxx=YWN0PWhvbWU%3D'; //ignore this

     }, 10000);

</script>

.htaccess file
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
 
If its only on your PC it could be loading the page from saved cache. Have you tried clearing site data and cache?
Yup I already tries clear my browser cache. The problem is not only occurred in my PC, my friends who tried to access the new domain URL (.gov.xx) will sometimes directed to the old unused domain URL (.com)... I found it weird coz they're two different domains, but the new one sometimes will direct/load the old (.com) URL...
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom