How do you use redirects (either a _redirects or toml file) in Netlify to redirect from a custom domain alias URL to a primary domain file path? - html

In my directory I have a _redirect file that contains the following:
https://revivifygame.com /revivify
According to the netlify docs, this should redirect revivifygame.com ---> itsmo.co.uk/revivify.
I own both domains mentioned above.
However, after deployment, the redirect is not working. Any help on what could be going wrong?

Related

How to make domain url lead to index.html?

How can i make that with entering mywebsite.com it leads to mywebsite.com/index.html?
I'm using siteground and I was recommended htacess but I'm really new at web programming, I don't know what that is and I really don't know what to do
In the Root folder of your website (on the server itself) is a file named .htaccess
That file contains information for the server, about which files and folders are accessable from the internet.
.htaccess can only be accessed when you are logged into your server account. It is a textfile in the Root folder of your hosting area.
In the file you can route all incoming traffic to index.php or index.html or whatever you like.
Here is some more info https://httpd.apache.org/docs/current/howto/htaccess.html
You will need to create .htaccess file in the directory of the website.
Inside it, at its very top, you should add:
RewriteEngine On
DirectoryIndex index.html
That will lead anyone to yoursite/index.html.

HTML Domain and Path

I was learning about HTML domains and paths in my computer-science class. However, I have a question. What happens if you only specify a domain, such as apple.com instead of specifying a path? Does the page automatically give you the index file or something?
Thanks :)
That entirely depends on what the web server is configured to do. What you’re doing is you’re requesting a URL from a web server via HTTP. That does not inherently have anything to do with files. The web server can respond to the request in any way it wants.
But yes, most typically the average web server will look for a file named something like index.html in its webroot folder and return it.
yes, there is the default file that is returned if no path is provided
From Apache documentation
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.
From IIS documentation:
Default documents are enabled by default, and IIS 7 defines the following default document files in the ApplicationHost.config file as server-wide defaults: Default.htm, Default.asp, Index.htm, Index.html, Iisstart.htm.
(If you install ASP.NET on your Web server, the installation process will add the Default.aspx file to this list.)

Permanently redirect Jekyll pages to external site without markdown?

Using Jekyll/Github pages. As part of a content overhaul, we've moved a lot of pages to an external site. We'd like to clean up our Github pages repository and remove all purged files while providing a 301 redirect to the new domain where they now live.
The problem is that - according to my understanding of the docs - you must have a markdown file present with a redirect_to field. This defeats the purpose of purging the files in our repo. Is there a way to configure redirects from the _config.yml file or a plugin that allows me to do this from a single file?
I cannot see how this can be possible on the GitHub platform. As you mentioned, you can use the jekyll-redirect-from plugin but you cannot automate it through config or other data files because Jekyll sites are static and thus, the server will only look for the directory and an index file within it for each URL.
The only way you can achieve this without keeping the file structure is to move the site to a server where you configure URL rewrites within the web server such as Nginx or Apache.

Index.html file is named as parent directory?

I have an contact.html file on the server in public_html.If I Move it into directory named: Contact, & rename it to index.html,does browser's Address bar shows it like: example.com/Contact/ ? I mean the name of file doesn't show up.
ANY help is appreciated.
Yes, example.com/Contact/ would work, but only if the server is configured with a default document index.html.
This is standard behaviour for apache web servers.
In your apache config there is a directive called
DirectoryIndex index.html ...
This tells the webserver to serve index.html in the case that a directory call was requested ... ie your example.com/Contact/ [Is a directory].
To change that behaviour you would need to look into change your server config, or adding an .htaccess file that would rewrite the URL to index.html

URL is not showing 404 page

I have a domain domain.com
And when I type domain.com/something.html/new/one/square/new.html I am not getting a 404 error.
Where something.html is present in the account correctly.
Directory new is present in my document root.
Square is not present in my account.
By default, if part of the url points to a file, the rest of the url is treated as so-called "path info". In php you should be able to get this path info by checking $_SERVER['PATH_INFO']. If you don't want Apache to work like this, turn path info off in your main config file (httpd.conf) or in .htaccess in your root directory with the following directive.
AcceptPathInfo Off
For more information, please check the documentation for AcceptPathInfo.