Jump to content

Automatic index.html loading


Cristiano

Recommended Posts

The index.html is usually the home page for the the domains root directory, anyone entering http://cristianopi.altervista.org/ should land on a index.htm|htm|aspx|php, or , default.htm|htm|aspx|php file. any link using href="/" would take to that root directory and index or default file. Anyone clicking on google link, or saved link to another page on your site, should not be redirected to somewhere they didn't want go UNLESS that page did not exist anymore.

Link to comment
Share on other sites

Suppose that someone, after a search on google, finds the link: http://cristianopi.altervista.org/as/pred_irnss-1h.html. If he clicks the link, the page is loaded but he doesn't see the index, but he could be also interested in the other pages. For that reason I need to automatically load also the index.html page.

Link to comment
Share on other sites

What you would normally do is use a server language such as php, create a single page with navigation only, with all links with home/index link page first. With this single nav page this can be included in all the other pages, just by  using <?php include 'nav.php'; ?> the navigation would be inserted into that page, and any other php page using that code. amending the nav.page, means that amendment would instantly show that amendment for all page using that code also.

This gives all the links to other page, on each page, i think this is what you are looking for? yes!

Link to comment
Share on other sites

57 minutes ago, Funce said:

I created the site http://cristianopi.altervista.org/as_old/ and the file .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^as_old/index.html$
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js)$
RewriteRule .* /as_old/index.html [L,R=302]

but when I click a link on the index page, the index page itself is loaded into the iframe (instead of the page in the link).

Link to comment
Share on other sites

20 minutes ago, Cristiano said:

I created the site http://cristianopi.altervista.org/as_old/ and the file .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^as_old/index.html$
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js)$
RewriteRule .* /as_old/index.html [L,R=302]

but when I click a link on the index page, the index page itself is loaded into the iframe (instead of the page in the link).

I see, you'll probably need a server side language like PHP instead. I've misunderstood your issue.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...