after I uploaded an html file to the servers hosting my domain, for example a file named a.html uploaded to b.com, I need to type the url: b.com/a.html to see the contents of the file. But how can I have a website/content in b.com without any files? Meaning that when I search b.com I will see some content without adding "/a.html"
Rename a.html to index.html (or create a new file). Then take a look a b.com.
When a webserver is pointed to a directory, it will look for a file with index as prefix. So when visiting domain.com, you will see the contents of index.html.
I found this at https://httpd.apache.org/docs/trunk/getting-started.html
Typically, a document called index.html will be served when a directory is requested without a file name being specified. For example, if DocumentRoot is set to /var/www/html and a request is made for http://www.example.com/work/, the file /var/www/html/work/index.html will be served to the client.
Related
In hosting, there are folders of a.mysite.com, b.mysite.com, c.mysite.com ....z.mysite.com within the root folder of mysite.com, and each site file is stored.
What I want is without installing all robots.txt files in each subdomain folder.
It is to install only one in the mysite.com root folder and share it all. Because all you need is a robots.txt file in its most basic form.
so in the end
When connecting to a.mysite.com/robots.txt, b.mysite.com/robots.txt, etc., you want to be properly connected to the robots.txt file.
I used to use Apache + .htaccess to serve a index.html page in a subdomain. The .htaccess redirected every pathname in any subdomain to the index.html itself.
For example:
In http://path1.myserver.com/chat, chat wasn't treated as a path, but as a "parameter" to the index.html file.
Also, http://path2.myserver.com/chat would be redirected to the same index.html file.
When I changed the server to Node, I couldn't (shouldn't) use .htaccess anymore.
How can I move from Apache to Node, keeping this functionality?
I tried to use vhost + router, but unsuccessfully.
I can set vhosts to serve *.myserver.com to a specific router, so http://path1.myserver.com and http://path2.myserver.com are correctly redirected to the same index.html, but when I try http://path1.myserver.com/chat, chat is being treated as a path, giving me a 404 error.
I need to make sure that every pathname in the pattern *.myserver.com/*/.../* be served by the same index.html (like done in .htaccess).
I don't know if this counts as a redirect, but I need all url's that start with a to open up the index.html in their first directory. Meaning website.com/blog and website.com/blog/3 both use website.com/explore/.index.html file, while website.com/albums, website.com/albums/john-smith, and website.com/albums/john-smith/4 all use website.com/albulms/index.html
Is there anyway to make the index.html files load without changing the redirect of the url itself?
I have installed the plugin 'Advanced Search Plugin Like Facebook Search' of younet and I noticed the error that application/modules/Core/externals/scripts/ynadvsearch.php is not found.
Then I checked the location and the file was there. So I uploaded a test.php file and typed the url in address bar then also I could not access the test.php page. But I am able to access all the js pages on that folder.
I have deleted the htaccess file of external folder. But the issue remains the same.
How can we fix this?
It's a little weird, usually /externals/scripts folder is used only for javascript-files (and all php-files - inside of /controllers folder).
File .htaccess inside of /externals folder contains a rule
<FilesMatch "\.avi|flv|mov|wmv|wma|mp3|mp4|m4a|mkv|swf|pdf|doc|ppt|ico|jpg|jpeg|png|gif|js|css)$">`
It means that *.php files are not allowed for access inside of this folder.
My "htdocs" folder is set to this: C:\webserver\xampp\htdocs
All my folders exist in subfolders of this folder.
I have such another folder here: c:\MyProjects\project1
I need to htaccess rewrite so, when I write: http://127.0.0.1/project1/myfile.php
On my browser, I will see the result of "myfile.php" inside "project1" folder.
Is it possible?
Is it possible?
No, you can't rewrite a URI outside of your document root, C:\webserver\xampp\htdocs. And htaccess file sitting in that htdocs directory won't be able to point a request outside of the htdocs directory. Mod_rewrite isn't what you want anyways. You want to use mod_alias from within the vhost config or server config. Something along the lines of:
Alias /project1 C:/MyProjects/project1
See also: Make XAMPP/Apache serve file outside of htdocs