2

So I have an .htaccess in the root of my website folder

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

that will hide the .php in the url.

This works perfectly fine with the other links except for one.

 <li class="dropdown <?php echo c("index"); ?>">
           <a href="index" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Home<span class="caret"></span></a>
            <ul class="dropdown-menu">
                <li><a href="index">Customers</a></li>
                <li class="<?php echo c("product");?>"><a href="index#product">Products</a></li>
                <li class="<?php echo c("consulting");?>"><a href="index#consulting">Services</a></li>
              </ul>
           </li>
           <li class="dropdown <?php echo c("products,product,consulting"); ?>" >
           <a href="products" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Products/Services<span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li class="<?php echo c("products");?>"><a href="products.php">Overview</a></li>      
                <li role="separator" class="divider" ></li>     
                <li class="<?php echo c("product");?>"><a href="products.php#wrapper">My product</a></li>
                <li class="<?php echo c("consulting");?>"><a href="products.php#consulting">Consulting/Development</a></li>
              </ul>
            </li>

If I click on the other links, the url will look something like this http://localhost/newdesign/en/careers and will successfully redirect to the right page.

But when I click on the products menu the link becomes http://localhost/product

Thus, producing an error. I tried checking all the links to make sure I put the correct URL. It's just strange that this only happens on that specific menu.

Any help would be appreciated. Thanks!

  • 1
    Why you have `href="products.php"` since you want to *hide the .php*? – Kuba Wyrostek Jan 25 '16 at 09:09
  • @KubaWyrostek I did not remove it since I was being redirected to the wrong directory without the .php. Thanks, though. I already found a workaround. I changed the file name from products.php to product. Maybe it has something to do with 'products' being a reserved word or something. – Eishia Konno Jan 25 '16 at 09:47

0 Answers0