htaccess and excluding files

Discussion in 'Apache' started by 15DigitalMarketing, Apr 30, 2007.

  1. #1
    Hi
    I am using the htaccess file to show SEO friendly URLs on my website www.homebuyelectrics.co.uk.

    BUT when you go to the New Products section you get an error when using the 'next' links to go to the next page. The page you are sent to is http://www.homebuyelectrics.co.uk/products_new.php/page/2 - which shows an error, but if you go to
    http://www.homebuyelectrics.co.uk/products_new.php?page=2 - the correct products show.

    Can I disable the ModRewrite for the products_new.php page? If so, how?
    Also, the code in my htaccess file is:
    # SEF BEGIN
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*) index.php
    # SEF END

    Hope somebody can help me!
     
    15DigitalMarketing, Apr 30, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Put something unique in the URL, like a directory or extension.

    And a tip: Get rid of the 'products_new.php' in the final URL.
     
    Nintendo, Apr 30, 2007 IP
  3. 15DigitalMarketing

    15DigitalMarketing Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Nintendo - Thanks for helping but I am completly new ModRewrites and are unsure how to do what you're suggesting.

    Could walk me through it please :) If it will take time then email me and we can some sort of arrangement.

    Thanks
     
    15DigitalMarketing, May 1, 2007 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^page/([^.]+)$ products_new.php?page=$1 [L]

    homebuyelectrics.co.uk/page/2
     
    Nintendo, May 1, 2007 IP