简体   繁体   中英

Not able to hide Index.php page on URL

I run a site using Joomla cms where we disabled index.php in URL but it doesn't work now

mysite.com/index.php

Then we tried with .htaccess file with following commands then at the homepage its disabled

       # Directs all EE web requests through the site index file
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule ^(.*)$ /index.php/$1 [L] 
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#

Works fine on the home page alone

mysite.com

But when I pass to any page from the home page it throws an error, when I tried with index.php in between then it works,

mysite.com/something    #throws error with this URL
mysite.com/index.php/something  # works fine with this URL

I need help to permanently disable the index.php inside URL even when I try to pass on to any other page from the home page, thanks in advance.

Did you add following lines at the beginning?

Options +FollowSymLinks
RewriteEngine On

# your rules here

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^(.*)$ /index.php/$1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM