Elxis CMS Forum

Support => General => Topic started by: bully on December 10, 2018, 14:12:10

Title: html and php page extensions showing, no way to hide them?
Post by: bully on December 10, 2018, 14:12:10
Hello,

I have just noticed, that somehow on all sites the .html extensions suddenly appear.
I am sure, that was always turned off.

Friendly URLs = on
SEO Titles match  = mormal

added to .htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html

No luck either,
Anyone knows a how-to?
this goes trough really all versions of elxis 4x and before

bully
Title: Re: html and php page extensions showing, no way to hide them?
Post by: xmanhattan on December 11, 2018, 13:53:44
Hello bully,

These are the standard htaccess file contents for Elxis 4.x:

Code: [Select]
##
# Elxis 4.x htaccess file
# Copyright (C) 2006-2012 Elxis.org. All rights reserved.
# License: http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Elxis CMS is a Free Software
##

# Uncomment the lines bellow to add support for HTML5 video and audio
# AddType video/ogg .ogm
# AddType video/ogg .ogv
# AddType video/ogg .ogg
# AddType video/webm .webm
# AddType audio/webm .weba
# AddType video/mp4 .mp4
# AddType video/x-m4v .m4v

## Uncomment the following line, if it produces erors, comment it again
# Options -Indexes +FollowSymLinks

RewriteEngine On
# You should set: RewriteBase /elxis/ with slash at end
RewriteBase /elxis4/

# Rewrite rules for sample multisites appeared as sub-folders of the main site
# RewriteRule ^one/estia/inner.php estia/inner.php [L]
# RewriteRule ^one/inner.php(.*) inner.php [L]
# RewriteRule ^one/(.*) $1
# RewriteRule ^two/estia/inner.php estia/inner.php [L]
# RewriteRule ^two/inner.php(.*) inner.php [L]
# RewriteRule ^two/(.*) $1

#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d

# If you have renamed the administration folder change "estia" to the name you have set.
RewriteRule ^estia/inner.php(.*) estia/inner.php [L]
RewriteRule ^estia/(.*) estia/index.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php

## Security rules. Comment them if they cause problems to your site
# Block out any script trying to base64_encode crap to send via URL
# This rule is commented because it may cause some Elxis features to not work!
# RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]

What's this?
Friendly URLs = on
SEO Titles match  = normal

Are you using Elxis 3.x or 4?
Title: Re: html and php page extensions showing, no way to hide them?
Post by: bully on December 12, 2018, 07:09:09
WHat is this?
Friendly URLs = on
SEO Titles match  = normal

My selection inside the elxis settings  :D

It's elxis 4.6 in the case, where  I actually notice, but 4.2 is also affected and other versions. Also pre-4-versions.
In fact, I was pretty sure, that the extensions are not shown, however, in a current development I noticed it, was unable to hide the extensions and then searched backwards.
Title: Re: html and php page extensions showing, no way to hide them?
Post by: xmanhattan on December 12, 2018, 12:51:08
As I noticed that you mention running your own server in some other posts, I think that you have to check your server settings.

What versions are you using for
Php vers
Apache or other and vers
distro?

Have you checked this?
https://www.elxis.net/docs/using-elxis/getting-started/installation-guide.html (https://www.elxis.net/docs/using-elxis/getting-started/installation-guide.html)

I have multiple sites with Elxis 3.x and 4.x and other software running on the same server with different .htaccess using different versions of Php, and they work very well.
Title: Re: html and php page extensions showing, no way to hide them?
Post by: bully on December 12, 2018, 13:00:35
Yes, Elxis is installed and even working
<sarcasm>That's a really really cool answer. However, now, my grandma owns the servers.</sarcasm>
Which of the settings she should adjust?
Also nothing special in the hosting, cPanel servers on Centos. patched, not experimental as for standard webhosting. PhP 5 & 7 and maintained/ updated/ upgraded always before EOL versions, so all ~120 servers nothing special experimental and in the same configuration. (oh yep, they are licensed and legal, no cracked stuff)
Title: Re: html and php page extensions showing, no way to hide them?
Post by: xmanhattan on December 13, 2018, 09:17:13
<sarcasm>Wow, cool.  Since the problem has nothing to do with Elxis, problem solved!</sarcasm>
Go to https://www.linuxquestions.org/questions/centos-111/ (https://www.linuxquestions.org/questions/centos-111/) for your solution.
Title: Re: html and php page extensions showing, no way to hide them?
Post by: bully on December 13, 2018, 11:13:55
<fact>This mo solution, not even an idea</fact>

Somehow I looked an idea, and if you not have, then say so/nothing.
Title: Re: html and php page extensions showing, no way to hide them?
Post by: datahell on December 16, 2018, 22:58:53
I have just noticed, that somehow on all sites the .html extensions suddenly appear.
I am sure, that was always turned off.

.html extension is always visible in Elxis for article and some other pages. Category pages and others have no extension.

Sample article page: sports/football/primera-division.html
Sample category page: sports/football/