How does the webserver know where the website is? - http

For example, when I type stackoverflow.com, I understand how the correct webserver is found. But how does the webserver know which folder to show?
I would guess that there is some kind of config for domain->folder? How does that work?

by visiting stackoverflow.com you open the / route so it searches about this route in its routes and runs the function with this route

Related

How to set root URL for Goutte driver?

I've started learning to use Behat and I've hit a snag: from what I understand the Goutte driver is simulating a user interaction that will follow pre-written scenarios, but when I launch Hehat through the console, i see that the url Goutte is reaching using visit('/') is http://localhost/ which is the WAMP homepage.
(I tried using visit() with the full url to no avail).
What I need is for Goutte to be by default at localhost:8000 which is where the test website is. So how can I specify which url is the root so that visit('/') will point to the homepage ?
I ended up finding out that just adding a base url variable to behat.yml was enough to do it, my bad. Although it was found in no documentation, just the luck of finding the right thread.

How to create an a virtual hostname or a simple url for appmaker

The URL for app-maker is always pretty complicated and is not human readable...
Is there a way to configure a host name or simplify the URL, in order to have the users being able to remember it?
for example:
myapp.mydomain.com
or at least:
scripts.google.com/myapp_prod or similar?
Until now I wasn't able to find out a way to have a fixed URL for the prod deployment for example.
If you want that for accessing purposes only and if you have some kind of hosting, a permanent redirect will do the trick. Alternatively, you can use some javascript to redirect to the app url whenever the home page is loaded.
window.open(appurl, "_top");
But other than that, the comment provided by Markus Malessa is the most correct one.

Switch host from localhost/website to website/ Symfony URL

I'm sorry if this question seems to be stupid...I've just forgot how to do that.
If my main URL is : http://localhost/Website/web/app_dev.php/
I would like to access the same page with the URL Website/
I remembered it were about hosting so I've just add 127.0.0.1 website to my hosts file and now I can access with the URL http://website/Website/web/app_dev.php/
But I still miss something to get what i want...i just can't remember where I have to go, I think it's not really and directly Symfony related problem. Have you an idea ? Thanks a lot
If you are using the builtin server (bin/console server:run or start) then you have to specify the port also (http://localhost:8000/Website/web/app_dev.php/)
In fact I figure it out, it was the file httpd_conf from apache i was looking for. It's all fine now. Sorry for your time.

Developing ASP.NET Facebook App Locally

I've searched around and found a lot of advice saying to modify the hosts file as such:
127.0.0.1 mydomainname.com
I've done that, but my actual site at mydomainname.com is still being used. Any other troubleshooting steps I could take? Any other suggestions?
Restart your browser, try ipconfig /flushdns (I'm a bit hazy on Windows DNS caching so that may or may not help here) or restart your computer. Unless you've done something really weird, the hosts file should have priority, so something must be caching the DNS result.
simply setup your canvas address as localhost. Unless you're using FBML, it works. See http://fbgraph.computerbeacon.net/tutorial/section1/createnewapp.aspx for an example.
Just make your redirect_uri your localhost address like:
https://graph.facebook.com/oauth/authorize?client_id={consumerKey}&redirect_uri=http://localhost:4403/Handshake
I have mine set up in visual studio to switch between localhost and live return_url's depending on whether debug or release is selected

My hosting is messing up my urls

Usually when I get the url of a request i use Request.RawUrl.
This gives /default.aspx for example.
However recently my host changed something and now the name of the application directory is displayed as well so i get /appdirname/default.aspx.
Now why does it give me the directory of the application? It looks as if my website is a subapplication of another website. So when you go to mydomain.com the rawurl will be:
/appdirname/default.aspx
I believe each domain has it's own website defined in iis or am i mistaken.
I am not asking for a workaround, which should be pretty straightforward, I am asking why this is happening and how, what kind of IIS setup causes this to happen?
PS.
And the worst part is i had this issue with godaddy and i was happy my host didnt have it but now both hosts have the same problem.
The Request.RawUrl method returns everything after the domain declaration, so if your full url is:
http://www.yourdomain.com:8080/directory/Page.aspx
then the method will return
/directory/Page.aspx
That's all it does. That's all it claims to do. As you say, your hosting provider must have changed something, which is very naughty, and the workaround should be easy. There is a good chance that they have introduced some kind of url redirection, but the best way to find out is to get in touch with their helpdesk and ask them what is happening. I find that most successful hosting companies tend to respond in good time to this kind of question. Otherwise they tend to become formerly-successful hosting companies.
Ric Strahl has this to say about it: http://www.west-wind.com/weblog/posts/132081.aspx

Resources