I'm writing a plugin currently, and I'm needing to add a rule to my .htaccess file to complete its functionality. I'm trying to redirect requests from /go/alphanumericstring to /index.php?gocode=alphanumericstring. I've been trying to get my rewrite rule working for a couple hours now, but it's still not working. Here's my .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /sites/test-wp/
RewriteRule ^go/([A-Za-z0-9]+)/?$ /index.php?gocode=$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /sites/test-wp/index.php [L]
</IfModule>
# END WordPress
The bold line is the one that I am having trouble with. I've tried several iterations of it, moved it to different locations in the file, and even put it above the "Start WordPress" line (with a RewriteEngine On line, of course). Nothing is working.
Does anyone have a solution?