Index.php stays visible on subpages

Permalink
Hi,

Currently we have a site running: moederagnes.be
When you visit a subpage index.php is visible. When going to SEO and enabling pretty URL's i get this message : "it was not possible, to identify server type... " I edited the .htaccess file with :
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --

With no effect. This is the first time we've experienced this problem.

Concrete version 8.0.3. Apache server.

 
ob7dev replied on at Permalink Reply
ob7dev
Is the server running virtual hosts? .htaccess may be ignored altogether if the sites virtual host config file is has Override set to none.

If you are running you own apache server its actually more secure to put the htaccess info into the virtual host config files rather than use an .htaccess file. Htaccess file is so web hosts can give shared hosting customers a little control over how the server runs their site, but its not needed if you are the apache owner youself.

A basic virtual host file running concrete5 with pretty URLS would look like this:
<VirtualHost *:80>
        ServerName www.servername.com
        ServerAlias servername.com
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        <Directory /var/www/html>
            <IfModule mod_rewrite.c>
              RewriteEngine On
              RewriteBase /
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME}/index.html !-f
              RewriteCond %{REQUEST_FILENAME}/index.php !-f
              RewriteRule . index.php [L]
            </IfModule>
        </Directory>

Additionally, make sure the apache mod_rewrite is enabled, via:
a2enmod rewrite
then run
service apache2 restart
or
systemctl restart httpd.service
(depending on distro)
Steevb replied on at Permalink Reply
Steevb
Also depends on where your htaccess file is compared to the site files.
grafoman replied on at Permalink Reply
the htaccess file is located at the root of the ftp
grafoman replied on at Permalink Reply
Hi,

I don't think the server is running virtual hosts?
We don't have this problem with al our other sites that uses the same hosting: one.com

So i just copied the .htaccess file from one of those.

Full .htaccess code:
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
        # -- concrete5 urls end --
<IfModule mod_deflate.c>
    # Force compression for mangled headers.
    #http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-g...
    <IfModule mod_setenvif.c>
        <IfModule mod_headers.c>


The .htaccess file is located on the root of the FTP.