1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

htaccess rule not working as expected

Discussion in 'Site & Server Administration' started by JEET, Jun 1, 2016.

  1. #1
    Hi,
    I got the following in my htaccess file:

    Options -Indexes +FollowSymLinks
    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*[^/]) index.php?show=$1 [L]

    I'm thinking that if a file already exists, then this rule should be ignored, and that file should be used instead of index.php
    That is not what is happening.
    Even if the file exists, the server is following this rule and not loading the specified file

    For example:

    mydomain.com/xyz
    is working because there is no "xyz" file

    but:
    mydomain.com/images/logo.jpg
    doesn't work, and it shows the home page, which is in the rule (index.php)
    This is messing up my template which shows the image file.

    What should I do?
    It's not just about images, php, etc files that "exist" are ignored as well.
    BTW, it's working fine on my dev server, just the production server messes up everything. I cannot change INI or conf files on the production server

    What to do?
    Thanks
     
    JEET, Jun 1, 2016 IP
  2. postcd

    postcd Well-Known Member

    Messages:
    1,037
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #2
    postcd, Jul 29, 2016 IP