Support

Admin Tools

#15045 Use of both index.htm and index.php

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Friday, 15 February 2013 10:14 CST

roger

Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? Yes
Have I searched the tickets before posting? Yes
Have I read the documentation before posting (which pages?)? Yes
Joomla! version: Joomla! 2.5.9 Stable [ Ember ] 4-February-2013 14:00 GMT
PHP version: 5.3.21
MySQL version: 5.5.27
Host: (optional, but it helps us help you)
Admin Tools version: 2.4.4

Hello,

I´m working on a dev site, which is offline for the general use (I´m using offline.php to show a 'Under Construction' page).

As the client don´t want the User and password fields to be shown to the general public, I created an index.htm file in the root of the site, so the htm is served if a user access the site, but my clients may 'see' the login form by appending 'index.php'.

This was working great, but when I used htaccess maker, it stoped working. By changing the 'Force index.php parsing' I may force using always .htm or .php, but not both.

Is there a way to acomplish this, or the only way would be disabling the htaccess AT created temporarily?

Thanks,

Roger.

 

nicholas
Akeeba Staff
Manager

The exact name of the .htaccess option is "Force index.php parsing before index.html" and its documentation description reads:

Some servers attempt to serve index.html before index.php. This has the implication that trying to access your site's root, e.g. http://www.example.com, will attempt to serve an index.html first. If this file doesn't exist, it will try to serve index.php. However, all of our Joomla! sites only have the index.php, so this checking slows them down unnecessarily on each page request. This rule works around this problem. Do note that some servers do not allow this and will result in a blank page or Internal Server Error page.

Have you considered that this describes exactly what you are requesting support with, therefore you could just turn off that option?

By changing the 'Force index.php parsing' I may force using always .htm or .php, but not both.

By default, your server looks for index.htm[l] before index.php. By enabling that option we tell your server to look for index.php before index.htm[l]. What is the third option that you are thinking of, because I am confused? When there are two items A and B you can order them in two ways: 1. A, B and 2. B, A. You seem to imply that there is a way to order them both at the first place. How does that translate to server behaviour? Present a page which contains both the index.htm[l] and index.php contents?!

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

roger

Hello Nicholas,

thank you very much for your quick response. Please let me explain what I meant by 'both'.

Let´s say we have the site example.com, under which root we´ve created one index.htm file and one index.php file.

The index.htm file contains an 'under construction' page without the login form, and index.php is the regular one, with the login form for administrators.

So, if a user goes to example.com, the file .htm is served, but if our client needs to login to the site, they can login going to example.com/index.php.

Now, when 'Force index.php parsing' is ON, the .htm file is never served (as it should, it is the purpose of that option).

However, when 'Force index.php parsing' is OFF, going to example.com gives you the .htm file, but when going to example.com/index.php you are redirected to example.com, so there´s no way of reaching the login form.

We have this 'index.htm/php system' in two other sites and it´s working ok. They have also AT installed, so I guess the main difference is that the option 'Generate htaccess' had not been used in them yet.

We´ve already used 'Generate htaccess' in example.com, and I guess that if we revert htaccess to the original one that comes with Joomla we we´ll get the behaviour we need.

So rewording the original question, is there a way of achieving the desired behaviour without reverting to the original htaccess provided with Joomla?

Thanks!
Roger.

nicholas
Akeeba Staff
Manager

However, when 'Force index.php parsing' is OFF, going to example.com gives you the .htm file, but when going to example.com/index.php you are redirected to example.com, so there´s no way of reaching the login form.

That happens because you have enabled "Redirect index.php to the site's root".

I am not sure that you've actually read the documentation. Please do it now. You have to understand exactly what each option does before enabling it. This is also written in the documentation :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

roger

Hello Nicholas!

Thanks, that was the problem. I´ve indeed read the documentation a couple of times, it´s just that I didn´t make the conexion one option afected the other. ; )

Regards,

Roger.

nicholas
Akeeba Staff
Manager

You're welcome, Roger!

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!