PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, October 15, 2022

[FIXED] How to change domain .net to .com using JavaScript

 October 15, 2022     dom, javascript     No comments   

Issue

I have small query today I happen to see when I typed a website "http://www.websitename.net"

it automatically got converted to "http://www.websitename.com" i.e., .net to .com and then the page as loaded.

I am eager to know how it has been done.


Solution

This is generally done as a server-side redirect.

You can watch the network traffic and see for yourself what happens. For example in IE9, use the Developer Tools (F12), click the Network tab, and click the "Start capture" button to start monitoring. Other browsers have similar features.

In the Response headers you'll see something like

Key         Value
Response    HTTP/1.1 301 Moved Permanently
Location    http://mywebsitename.net


Answered By - Eric J.
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing