I am working on a Wordpress project. I created a page just like author.php and need to pass parameters to it and want the address to look like the authors url (http:// somesite.com/author/thisguy) - let us assume my new page is xyz.php and I am passing http://somesite.com/xyz/thisguy
I read somewhere that I couldn't use the wp_rewrite because it is used only with index.php and my page is xyz.php
Therefore I'm trying to do this with .htaccess file.
I need to interpret (alias / RedirectMatch) this: http:// somesite.com/xyz/thisguy as http://somesite.com/xyz.php?myname=thisguy
Currently my .htaccess file looks like this: (Note that it has a rewrite mention for the membership plugin S2Member but I don't think it matters)
# BEGIN s2Member GZIP exclusions
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+
RewriteRule .* - [E=no-gzip:1]
</IfModule>
# END s2Member GZIP exclusions
# 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
I tried:
RewriteRule ^xyz/(.*)$ xyz.php?myname=$1
but didn't work.
Your help is greatly appreciated.