Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2016
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    rewrite rules (.htaccess)

    Hello Everyone,

    I am currently working on rewrite rules on .htaccess and it doesnt seem to be working. any ideas? I am using wamp during production.


    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^product/?$ view/inventory.php
    Code:
    <li class="last"><a href="<?php echo BASE_URL; ?>view/Inventory.php">Inventory</a></li>
    Thanks!!

  2. #2
    Master Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    5,512
    Thanks
    22
    Thanked 567 Times in 560 Posts
    this is not a PHP question => let it move to the Apache forum

    {...}view/Inventory.php definitely does not match ^product/?$, insofar your code cannot possibly work.

    there is also a difference in letter cases which on case-sensitive systems (such as the typical linux server) does not cause a file match.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  3. #3
    New to the CF scene
    Join Date
    Jan 2016
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    why doesnt it match, i dont understand.

    Code:
    <li class="last"><a href="<?php echo BASE_URL; ?>view/inventory.php">Inventory</a></li>
    the base_url is a constant which i have set on a config file. Is that conflicting with the rewrite rules?
    in the url i still want the base_url to appear i just want view/inventory.php replaced with product.

    Based on the examples i have seen online i dont understand why my rewrite rules dont work.

    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^product/?$ view/inventory.php


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •