0

I have an older phpPHP website where i try to remove the .php extension from phpPHP files getting accessed and showing in the browser.

After iI have added the relevant .htaccess parts and changed href from href="index.php" to href="index" the page wont load, why is this?

.htaccess

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [L]

Header.php

                            <div class="span9">
                                
                                <nav>
                                    <ul class="menu">
                                        <li<?php echo SITE_SELECTED_PAGE == "home" ? ' class="current-menu-item"' : ''; ?>><a href="index"><?php echo strtoupper(t('create_url', 'create url')); ?></a></li>
                                        <li<?php echo SITE_SELECTED_PAGE == "subdomain" ? ' class="current-menu-item"' : ''; ?>><a href="subdomain"><?php echo strtoupper(t('subdomain', 'subdomain')); ?></a></li>

                                    </ul>
                                </nav>                                      
                            </div>
JoeriDo
  • 53
  • 3
  • Is that all you have in your .htaccess file? You also need the `RewriteEngine On` line, otherwise the directives won’t do anything. – MrWhite Jan 08 '22 at 12:10

0 Answers0