?
avatar Radek-Suski
Radek-Suski
26 Mar 2014

Hi,

it's not an issue as such but maybe we could rename htaccess.txt to .htaccess by default and add a conditional statement in .htaccess itself


RewriteEngine On
....

avatar Radek-Suski Radek-Suski - open - 26 Mar 2014
avatar Radek-Suski Radek-Suski - change - 26 Mar 2014
The description was changed
avatar Radek-Suski
Radek-Suski - comment - 26 Mar 2014

<IfModule mod_rewrite.c>
RewriteEngine On
....
</IfModule>
You may blame the J!Tracker Application for transmitting this comment.

avatar mbabker
mbabker - comment - 26 Mar 2014

If Apache were the only environment that the CMS is supported on, this could be possible. However:

1) The project supports Apache, IIS, and nginx, each having different server environments (IIS doesn't use .htaccess)
2) There are hosts where enabling a .htaccess file by default would cause more harm than good

avatar betweenbrain
betweenbrain - comment - 26 Mar 2014

I agree that enabling it by default could cause issues.

FWIW, nginx does not use .htaccess either.

avatar Radek-Suski
Radek-Suski - comment - 26 Mar 2014

But as You wrote, IIS doesn't use htaccess at all and if I am not wrong also nginx doesn't
You may blame the J!Tracker Application for transmitting this comment.

avatar mbabker
mbabker - comment - 26 Mar 2014

Enabling any of the configurations by default would mean that our script would have to properly detect the software running on the server AND we, the project, would be responsible for troubleshooting issues that arise from blindly enabling .htaccess (or web.config for IIS, or nginx' solution) in environments where our default configuration just does not work. It is safer to not do this and make it a deliberate action by the user to perform this step.

avatar codekreis
codekreis - comment - 26 Mar 2014

I have to agree with @mbabker that this might throw a lot of problems. But if i'm guessing right @Radek-Suski intention is to lower the amount of sites which are not using SEF-Urls just because they don't know about it. And this problem could be solved in different ways. One proposal: Add the ability to rename the htaccess from the backend. We could just bind it to the current "use htaccess" state and rename the htaccess.txt or htaccess-disabled (see below) to .htaccess if no .htaccess exists. Of course we need an ability to disable the htaccess, but prevent custom htaccess files from being overridden by updates. So if you disable the htaccess it should be renamed otherwise (e.g. htaccess-disabled).

avatar brianteeman
brianteeman - comment - 26 Mar 2014

It would be good if this could be done in the admin. We can test the server is supported and ensure that any existing htaccess is not overwritten without backup. This would be a great improvement just needs someone to write the code ;)

avatar mbabker
mbabker - comment - 26 Mar 2014

That I could support as it still requires a deliberate user action but does make it easier on the user.

avatar jmcameron
jmcameron - comment - 26 Mar 2014

Adding a back-end way to do it would be helpful. Many admins use FTP clients that are set up to ignore or not display files beginning with a period so they often have difficulties figuring out how to do this renaming.

avatar Bakual
Bakual - comment - 26 Mar 2014

It's also to mention that not only the mod_rewrite can cause troubles. My hoster for example doesn't allow the options directive in the .htaccess. So I have to comment out Options +FollowSymLinks or I get an internal server error.
That also means that the administrator will be unable to reach since it will trigger the same internal server error as well. So if we provide a way to rename the htaccess.txt from the backend, it may render the backend unreachable depending on hoster. That's quite bad actually.

avatar brianteeman
brianteeman - comment - 26 Mar 2014

I actually wonder if that line Options +FollowSymLinks is even needed in a default setting

avatar sybrek
sybrek - comment - 26 Mar 2014

@Bakual We could check if there is any trouble with "our" htaccess file. Just move the .htaccess temporary to (for example) joomla-root/tmp and check if it causes problems by getting the http status code.

avatar Bakual
Bakual - comment - 27 Mar 2014

I actually wonder if that line Options +FollowSymLinks is even needed in a default setting

I have no clue. It's enabled by default on my hoster anyway and I never tried on my test server to disable it. :smile:

We could check if there is any trouble with "our" htaccess file. Just move the .htaccess temporary to (for example) joomla-root/tmp and check if it causes problems by getting the http status code.

That could work if you move it to a directory which isn't used otherwise. It just sounds a bit complicated just to save the user a manual step. And it likely still wouldn't be 100% foolproof.

avatar betweenbrain
betweenbrain - comment - 27 Mar 2014

There is certainly a lot of risk with something like this, but also potential. I would suggest that if this were done via the backend, it be tied into the global configuration option to enable SEF URLs. Moving it temporarily to /tmp may work to check with server comparability and conflicts, but I don't think that would be a thorough enough test as it isn't checking whether or not the rewrite rules are actually working. We would probably then need to check a real SEF URL, and may even need to set the value of rewriteBase. We might even need to look at checking file permissions and writing the file like we do with configuration.php.

That said, it would be very cool if that all happened automatically when enabling SEF URLs.

avatar nternetinspired
nternetinspired - comment - 28 Apr 2014

There might be a pre-existing .htaccess in an installation directory, which would then be overwritten if this were changed.

In addition the OSX default to hide dotfiles would mean that a user developing in a local environment would be unaware that the file even existed.

avatar betweenbrain
betweenbrain - comment - 2 Oct 2014

Closing this issue as there has been no activity in 5 months.

avatar betweenbrain betweenbrain - close - 2 Oct 2014
avatar zero-24 zero-24 - close - 2 Oct 2014
avatar betweenbrain betweenbrain - close - 2 Oct 2014
avatar betweenbrain betweenbrain - change - 2 Oct 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-10-02 00:27:08
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment