Htaccess question

Discussion in 'Site & Server Administration' started by fri3ndly, Aug 31, 2011.

  1. #1
    Please can somebody help me out with the following:

    
    <IfModule mod_rewrite.c>
    
    	RewriteEngine On
    	RewriteBase /
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteCond %{REQUEST_URI} !example.php
    	RewriteCond %{REQUEST_URI} !(.*)/$
    	RewriteRule ^(.*)$ $1/ [L,R=301] 
    
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteCond %{REQUEST_FILENAME} !-d
    	RewriteRule ^(.*)$ /index.php?slug=$1 [L]
    	
    </IfModule>
    
    Code (markup):
    This takes any URL like website.com?slug=sfgsfg&slug=adfsd&slug=sdvssgd and redirects it to website.com/sfgsfg/adfsd/sdvssgd/ which works fine but the problem is that anything that is not recognised such as website.com/?gclid=4b3iu53o4 also redirects back to index which means PPC tracking cannot be done properly.
     
    fri3ndly, Aug 31, 2011 IP
  2. cPAce

    cPAce Peon

    Messages:
    445
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I assume your using Wordpress as this is a common entry for Wordpresses built in permalinks which sucks by the way :p. If you can provide me a little more detail such as the site address and so forth, I should be able to spot what is causing this.

    PM it if you wish.
     
    cPAce, Sep 6, 2011 IP