I have a site, www.example.com that is hosted on Netlify. By default, index.html is served when visiting the domain. Is it possible to map the domain root to serve index.html? By this I mean that visiting www.example.com shows www.example.com/ instead of www.example.com/index.html
Related
I am having a issue with the redirects of my URL using Microsoft Azure Web Service.
When I am executing www.myurl.com I am going to the correct page.
If I remove the www and execute myurl.com it redirects me to a incorrect page. The page that is shown, is only avaiable through a sub domain like login.myurl.com.
I am hosting on Microsoft Azure Server.
The root of the server basically contains the index.html on which the main page should redirect. However, without the www it redirect into a folder on root, and goes to the index.php inside that folder. There are more subfolders and it doesn't go into the alphabetic first one.
- www
-- index.html (this should be called)
-- // login folder
---- index.php (this is getting called without www)
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 have domain registered in ovh. My site files are stored in folder called "www" in root directory. It was original ovh setup. A few days ago I discovered that i can use let's encrypt ssl certyficate. Now I have these addresses:
example.com,
www.example.com,
https://example.com,
https://www.example.com
I want to redirect:
example.com
www.example.com
https://www.example.com
to:
https://example.com
via .htaccess 301 redirection
I tried a lot of sample htaccess redirections from this and other sites. Non of them work perfectly for me.
For example redirection from example.com to https://example.com was ok, but from www.example.comtake me tohttps://www.example.com/wwworhttps://www.example.com with browser warning "unsafe content".
It is harder than i thought.
If you're using wordpress, you could install a simple pulgin called Really Simple SSl which will automatically do this redirection.
I'm working with a site that used to use a subdomain to link to an externally hosted blog. This has since been deleted and incorporated into the main site. The subdomain now just houses a .htaccess file with 301 redirects for the blog articles.
I also have a 404 page set up for any other remaining links to the subdomain. The problem is that I want the 404 to be served from the main domain, not the subdomain. Instead of blog.example.com/404, I want to serve www.example.com/404.
Not sure if it matters, but on the server, my subdomain is a folder inside of the main domain:
html/ = www.example.com
html/blog/ = blog.example.com
Remove any 404 ErrorDocument line from DOCUMENT_ROOT/blog/.htaccess
In your DOCUMENT_ROOT/.htaccess add this line:
ErrorDocument 404 /blog/404.html
As my title says, using htaccess how can I specify index.html as the home page with both index.html and index.php on the server ? I have a regular basic html site on the server and I want to start working on a joomla site which of course uses php. I don't want to redirect the php if I enter in the index.php into the address to allow me to start working on the joomla installation. I just want to automatically go to index.html when the domain name is entered. I hope I'm making sense. Thanks
You use DirectoryIndex to specify, which file is shown, when just the directory is requested
DirectoryIndex index.html