I've added some extra functionality to my wordpress so that I can visit it with a variable and do extra stuff.
The problem is, when I turn my ugly dynamic link into lovely permlink formatting in the .htaccess file, wordpress overrides it / ignores it. I've heard there's a way to do it, but the ways I try to do it based off what people have said still returns a 404 page regardless. I know that the file its pointing to works.
2 ways ppl say works but I've had no joy with:
1) insert the rules above the #BEGIN wordpress part 2) use add_rewrite_rule() wordpress function somewhere
Has anybody had any success with these methods? or other methods?
Here's what my .htaccess file looks like
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/ref/(.*)$ /index.php?ref=1&sid=$1 [NC]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
In my themes function.php I've also tried adding:
add_rewrite_rule('/ref/(.*)$', 'index.php?ref=1&sid=$matches[1]','top');
With no success.
I've also tried the solutions over @ http://stackoverflow.com/questions/723283/wordpress-modrewrite with no joy.
Please help! :)
any ideas?