I have a subdomain named: www.childsite.com which is a subfolder of www.mymainsite.com
I have created a subfolder called "dashboard" and put it in the domain folder, so I can access that using www.mymainsite.com/dashboard without any problems.
What I really wanted is to put the "dashboard" folder in the subdomain (www.childsite.com)
so the folder structure for that would be:
mymainsite.com
- childsite.com
-dashboard
but when i accessed the wwww.childsite.com/dashboard it gives me a "page not found" error...
In IIS:
Create a folder out site your root directory, if possible. Call it childsite. In your DNS, you will have to set a CName record for childsite.mainsite.com. On your server, if you are running IIS, create a new site with the host name set to childsite.mainsite.com. The root directory for this new site should be the folder you named childsite. If your folder named childsite isn't located in the root directory of mainsite.com then the users cannot access it by going to mainsite.com/childsite/ Simply put the folder dashboard within the childsite folder and you should be all set one the DNS records take effect. (If you're not hosting the DNS yourself.)
Related
when I try to install moodle via softaculous, I get an error like this, I just created my domain name and the files seem empty. Can you help?
Eror:
Could not access your domain. Please make sure your domain is pointing to this server and there is no .htaccess file restricting access to your domain
I get the error while loading Moodle, the contents of my files are empty and .there is no htaccess file
I'm new to HAPROXY's advanced ACLs and I need your help.
I would like to create a redirect based on the subdomain used.
Example :
I have one directory per site on my host.
If someone enters the URL https://test1.test.com, I would like them to be redirected to the test1 directory on the host.
The directory on my host will always be identical to the subdomain.
Example :
https://test2.test.com --> folder /test2
https://test3.test.com --> folder /test3
I would like to create a general rule that redirects to the right folder depending on the subdomain.
I don't know if I was clear enough?
Thank you in advance for your help.
Say I have a webserver data.mydomain.org.
Right now the webserver has an index.html with a redirect to info.anotherdomain.com.
In addition to providing a redirect, the server has other content like an images folder and a documents folder. These have to remain operational.
My DNS is GoDaddy. If I get on GoDaddy and add a CNAME of info.anotherdomain.com to data.mydomain.org , what happens to the subfolder paths? Will the CNAME make the subfolder paths resolve from lets say data.mydomain.org/images/image1.jpg to info.anotherdomain.com/images/image1.jpg? Or would subfolders be unaffected?
My goal is to get rid of the current index.html redirect and also have the page at info.anotherdomain.com come up in the address bar as data.mydomain.org
First of all DNS doesn't redirects it just route. So you will need the CNAME record to could even reach that subdomain.domain.tld.
But the redir, handling of folders and anything else must be performed from the HTTP server side.
I'm a bit confused as to how setting a source works for a script inside an HTML file.
Whenever I use a script, I set the source to something along the lines of:
http://localhost:8080/module_name/module.js
However, when I go through the directory of my server, the location is actually something along the lines of:
modules/module_version2.0/module_name/module.js
How is the client accessing the source file when portions of the directory are emitted?
I think what is throwing you off is the configuration and root of the web-server/website versus the file system of the server.
The URL being read by your browser/client will lead the browser/client to the web-server located at localhost:8080 and the web-server will supply the browser/client with information from that website's root directory for any files/pages that are referenced within the html being used via the tags.
The method of configuring this direction/reference to the root or the document tree of the web-server, varies based on OS and web server setup, but is usually held in a files like httpd.conf; which is the file for Apache.
These configuration files can also have different file locations and aliases setup to create relative paths: i.e. you could have pointers for different locations within the web-server's document tree.
The path example from your server is coming from the perspective of a user account logged in to a machine using some method of exploring the systems local file structure. As such the root directory of that system is the lowest location in the file structure and therefore will show the full path of all the files and directories on that machine.
Where as the web-server/website's root directory in most likely located further away from the systems root.
Hope this helps.
I'm dealing with an annoying problem. I have to make some changes to a large website, which source code is not under my control (sub-contracting). As usually I try to rebuild a local copy of the site to test my changes. The problem is now that almost all paths used in URLs for images, css, links etc. are relative paths pointing to the root directory, like
href="/style/main.css"
This is a problem because I develop on an intranet server and I put this project into a nested directory, so the URL to the project files is sth. like
http://myIntranet.com/checkout/project
What happens is that the paths from the first example don't resolve correctly. So I tried using the base tag to set the directory from which links should be resolved as
That works fine when the path is
href="style/main.css"
without the slash at the start, but fails when the slash exists, because (I think) the link is resolved from the server host, not from the URI in the tag.
So... is there any possibility to make the "/dir/file.html" links resolve from a root othe than the server root? Or do I have to manually remove all prepending slashes from the paths (urgh)?
Thanks in advance. :)
If you're doing local development on a web site you can do either of the below. Both involve moving your project in a base folder instead of working with sub folders inside your document root.
Virtual host on different port
In your web server, create another listening port and virtual host.
After restart, you can access your web server as http://localhost:81 or whatever port number you choose.
Virtual host on same port
Only create another virtual host (like above), but make sure to use named virtual hosting.
After restart, you have to add another entry in your hosts file (c:\windows\system32\drivers\etc\hosts or /etc/hosts) using a simple text editor:
127.0.0.1 localhost myproject1.self.com
The above line should already exist, so you can keep adding more names to it:
127.0.0.1 localhost myproject1.self.com myproject2.self.com
Personal preference
I like the second option, because I don't have to mess with ports and stuff like Facebook API keeps working as you expect.
I hope this all makes sense, let me know otherwise.