How do I redirect a URL? - php

I would like to forward:
www.example.com/intake
to:
xx.xx.xx.xx/forms/intake.php
Do I do this by using an A record?
When I try to do this on GoDaddy I receive an error. It wants just the IP address without the specified path.

To do this with godaddy, follow this guide: https://www.godaddy.com/help/redirect-urls-with-your-hosting-account-5120
If you want to hide the IP address, you are either going to have to set the A record of the domain to their IP and expect that server to have hosting for your domain name(not what you want), or you are going to have them listen for requests on a subdomain.
Other then that, if you are customer with godaddy, why not ask godaddy for support?

There's multiple ways to do what you want but using an A record has nothing to with url redirection, just dns pointers.
You can only do this if you have hosting attached to your domain name.

Related

How to prevent other website or domain from download our content and display it via CURL on their domain? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Recently we found our websites created on our domain gets automatically copied or mirrored at a different unknown domain website. These unknown websites at unknown domain are updating automatically whenever we update our websites.
https://ourdomain.com mirrored at : https://findacrew.se/index.php/SOCRATES
https://ourdomain.com/printversion/ mirrored at: https://findacrew.se/printversion/
https://ourdomain.com/News mirrored at: https://findacrew.se/News
https://ourdomain.com/Web-mail/ mirrored at: https://findacrew.se/Web-mail
Whenever we create any website on our domain it automatically gets created on this unknown domain.
Our hosting service provider Hostgator says : The issue is that the other site may download your content and display it via CURL.
Please help us by guiding what should we do to break this connection between our domain and this unknown domain.
Question update: 1: We have been told by our hosting providers support team that: The domain findacrew.se is pointed to our domains dedicated IP address. For example, if someone type http://findacrew.se/, it redirect to our dedicated IP which is address of our website. Since our domain is hosted on a dedicated IP, the domain findacrew.se will load the content of our site. How to Block other website domain DNS from pointing to our domain's dedicated IP address?
Question update: 2: Further update: We found that the domain has been registered by Eurodns.So we have filed a Complaint against domain findacrew.se to Eurodns with following content:
To
EuroDNS S.A.
Dear Sir,
Greetings
We are the legal owner of domain ourdomain.com with dedicated I.P.... A domain registered at you has been pointed to our dedicated IP address which is unethical and illegal. For example, if someone type http://findacrew.se/, it redirect to our dedicated IP ourdomain.com with dedicated I.P. ....., which is address of our website. Since our domain ourdomain.com is hosted on a dedicated IP, the domain findacrew.se loads the content of our site. Therefore It is a kind request to please Block this domain domain DNS from pointing to our domain's dedicated IP address. For your help we would be highly obliged. Please consider this request on a priority basis because we are facing serious issues every day.
Question Update : 3
We have discovered that all these domains from a single entity are pointed towards our IP address:findacrew.at findacrew.be findacrew.ch findacrew.gr findacrew.nl findacrew.ro findacrew.ru findacrew.se findascrew.com
We have been told by our hosting providers support team that: The domain findacrew.se is pointed to our domains dedicated IP address.
The problem can be solved by properly configuring your web server in order to serve your website's pages only when it is accessed from its URL www.socratesjournal.com
What is going on?
The DNS record for the domain findacrew.se is misconfigured or outdated and it turns out it points to your server's dedicated IP address.
When someone browses to findacrew.se, her/his browser queries the DNS server in order to resolve the domain name.
The DNS server returns your IP address (at the time of writing 216.10.241.94).
Then the browser connect to that IP address.
What is important to note is how the connection is established: when the browser connects to the resolved IP address the domain name is sent to the server (in the Host entry of the request headers):
Host: findacrew.se
Your website ignores the Host header and serves your website's contents despite of its value.
You should configure your website to return a 400 error status code Bad request (or drop the connection or serve a blank page) if the Host header value doesn't match with your website domain name.
If you miss to do that then it's your fault.
All that's happening here is that someone had a domain that previously used the same IP address you're using now, and they haven't updated it since. There's nothing malicious going on here.
We found that the domain has been registered by Eurodns.So we have filed a Complaint against domain findacrew.se to Eurodns with following content
This is laughable... there's certainly nothing unethical or illegal going on here. Your jump to conclusions have lead you astray from the technical problem.
How to Block other website domain DNS from pointing to our domain's dedicated IP address?
You don't. You don't own their domain... they do. You have no control over someone else's domain. By the way, you also don't own your IP address.
So, what do you do? It's very simple. Configure your web server to redirect to your domain with a 301 status code, indicating a permanent redirect. If it gets a request for a domain not configured, it redirects to the same path at your actual domain.
As for specifically how to do that... you didn't bother telling us what web server you're using so you'll have to Google for it or post a new question.
Why do we complex the issues when the solution is easy?
This is my solution which I found online. It really works fast and solved my problem.
Insert this code in your .htacces
RewriteCond %{HTTP_HOST} !^www.domainname.com$
RewriteRule ^/?(.*) http://www.domainname.com/$1 [QSA,R=301,L]

how to access PC from wan by domain

i am accessing my wamp server from WAN through PC's IP address 122.xxx.xxx.xx. but now i want to access my wamp through DOMAIN name.
i only have my domain name and no other credentials for setting. is it possible with domain name?
You need to point your domain name at that ip address. In your settings or admin panel where you setup/purchased your domain name set the ip address to the 122.xxx.xxx.xx you have been using.
This really depends upon your location.
If when you reboot your router you get a new WAN IP address every time, then you cannot use the domain name you have purchased. You would have to use a Dynamic DNS provider like DYNDNS.COM or Amnon's suggestion DNSEXIT.COM or one of the others that provide this service. With that service you will unfortunately have to use one of their sudo domain names, which means you will have to use something like YOURDOMAIN.ONE_OF_THEIR_DOMAINS.ONE_OF_THEIR_TLDS, so it would look like mydomain.dyndns.net they normally have quite a few to choose from, but it wont look like www.yourdomain.com
If you always have the same WAN IP address for your router then you can use you purchased domain name. You will have to contact whoever you purchased it from, they would normally provide a web site where you can login and set the ip address you want to use for the domain name you have purchased. Once that is done and you give the DNS servers a few minutes to a few hours to get updated you will be able to use that domain name.

htaccess redirect url/domain to my server using ip address

I have a web server with a website on the root IIS7 So it is wwwroot/mysite. This web server has about 20+ websites on. So I have a domain and only have access to it via ftp. Its Apache LAMP based stuff.
So I need to redirect www.mydomain.co.uk to my IP address 107.xxx.xxx.xxx and then to the right binding all from a .htaccess file.
Is this at all possible? Sounds a bit hacky to me. Currently I am just redirect www.mydomain.co.uk to www.mydomain2.co.uk. Maybe there is a way to mask the url.
Thank you in advance for any advice on this.
Since you have a domain, you could set a subdomain that points to the IP address of your server (107.xxx.xxx.xxx) and have everything else point to the other server. Then, you can set up an A record (if you have access to DNS editing from your domain registrar -- not your website host), to point the subdomain to your IP address (I'm currently doing this on one of my subdomains to point to my linux VoIP box while everything else points to my website).
I honestly don't know if PHP alone can accomplish this, but I know from experience that DNS Zones can.

PHP hosting and URL display

I have a site using PHP and MySQL. I have a domain name reserved by a domain name provider. I do not want to use the storage proposed by that provider to store my files, because it's really too expensive.
Let's say the domain name is : www.domainname.com
So... If I choose another provider (let's imagine it's free.fr) to store my site's files, what may I do, or what may I look for, to be able to have in my url bar :
http://www.domainname.com/onefolder/onegreatfile.php
instead of :
http://imhere.free.fr/innerfreefrfolder/onefolder/onegreatfile.php
If I activate the transparent redirection on my domain name, the url keeps being :
http://www.domainname.com
If I force the url bar to go to http://www.domainname.com/onefolder/onegreatfile.php
it returns a 404 not found error (The requested URL /onefolder/onegreatfile.php was not found on this server.)
The following is an oversimplification but it should be enough to get you where you need to go:
You'll want to sign up with a web host that allows you to use your domain name with their server. They will tell you what to set your name servers to so that any requests for www.domainname.com will result in the ip address of the server your files are stored on. Setting the name servers for your domain is usually done via a service provided by your registrar.
The transparent redirection you're referring to (some hosting sites call it Forwarding with Masking) is really just your hosted files displaying within an iframe on your owned domain name.
What you really need to look into is setting the DNS servers/Nameservers for your domain name to point to your hosted website/IP address.

Masking URL in Status Bar

I'm hosting my own website on my personal server running Ubuntu server. My public IP address is showing up in the status bar each time someone visits my sites or hovers over one of the links on the pages (i.e. when going to the home page it says waiting for myipaddress/index.php). I have purchased a domain name with godaddy. While I was able to find the option of mask the url in the address bar in the admin page, I was able to find no such option for the status page. Initially, I tried to embed JavaScript code into the php files but I later learnt from various posts (link) that we cannot control what is displayed in the status bar .
All I want to do is to display my domain name instead of my IP address each time the page loads and each time the user hover's over a link. Any ideas of how I should go about this?
You should just have your domain name point to your IP address and setup the site on your server to handle that domain. Then all requests will go to that domain name instead of directly to your IP address.
Note: it's very easy to find the IP address for any web server (based on a domain name) so you can't really hide it, but you can set it up so that it behaves just like any regular site that uses a domain name instead of an IP address.
Have you done anything to connect the webserver and the domain name? You're going to need name servers, often your domain provider will have something you can use, or you can run your own. The name server is like a phone book for websites. It says mydomain.com can be found at IP address 123.whatever. Until you have an entry in a name server 'phone book' you will not be able to access it through that domain name.
You'll also need to setup something on the webserver so it will know what to serve when it gets a request pointed to that domain, if you're using apache, likely it will be a virtual host entry in the appropriate config file.

Categories