How to add pages to a website

Can only 1 page be displayed to the public? add another html file for the next page

Hi and welcome to the forum! You can also add other pages by creating new HTML/PHP files (or, if you use WordPress or any other CMS, directly from the administration panel) and then linking to them on your website menus (like the one in the header or the footer); the latter can simply be done by copying an element from the header/footer menu’s list, pasting it above or below the other link, depending on where you want to show the other page, and changing the URL to the other page’s path and the text accordingly.

5 Likes

Can I only upload files in index.html format? It has to be index only and the url sigitsyg.rf.gd/?=1? Can I?

add url like sigit.rf.gd/home or /about or just sigit.rf.gd?=1

It can also not be an index page (though the home page needs to be an index page); it needs to have either one of .html, .htm or .php extensions and can also be a different name.

The final URL can also have no extension (and no other GET parameter as that is also a factor for search engine optimisation), but it’s better if you don’t hardcode the URL on your code as it can be a bit of a mess if you change domains or paths for your website as you also have to change them. But for an URL to have no extension you’ll have to create a .htaccess file on your htdocs folder or edit it with either this content:

Options +MultiViews

or this if you want to remove the extension for both HTML and PHP files only, which also works on servers that support .htaccess but don’t support/ignore the Options directive (not in our case, as the Options directive is supported:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]

If you don’t do it, the URL without any extension will direct you to a 404 page.

6 Likes

You can create whatever page you want at whatever URL you want, using whatever method you want.

InfinityFree is a web hosting service, not a website builder. There is no limit to the number of pages you can have on our service, and we’re not forcing you to use any specific tool or method to create them.

Using the multiviews method that @JxstErg1 used it one method.

Another option to setup a page at sigit.rf.gd/about is to just create a directory with the name “about” in your htdocs folder, and put your index.html in that folder.

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.