How To Exclude File from Wordpress Redirect

2 replies
I have a Wordpress site and am trying to create a friendly url for an affiliate link masker.

I have a file called hoplink.php and I need to pass a value vin=xxxxx but I want to include the url like domain.com/hoplink/xxxxx

I have tried the code below in the htaccess file but it seems to still be picked up by wordpress and treated as a 404.

Any Help would be appreaciated.


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^hoplink/([A-Za-z0-9-]+)/?$ hoplink.php?vin=$1 [L]
</IfModule>

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

John Hocking
#exclude #file #redirect #wordpress
  • Profile picture of the author HDRider
    Maybe try a Wordpress plugin called GoCodes. You could set what you want after your domain, hoplink/xxx instead of go or buy after links.

    Not sure using htaccess maybe ask in the programming section.
    Signature

    ~ Ultra Fast Product Creation - Creating your own products is where the real money is... Let me show you how in this step by step guide.

    ~ Get Your Mind Right and Everything Else is Easy! Law of Attraction States...You Attract What You Think About.

    {{ DiscussionBoard.errors[9794917].message }}

Trending Topics