Forum Moderators: phranque
I was able to achieve that with:
RewriteCond $1 !^(access\.php) RewriteRule ^(.*)$ access.php?page=$1 [L] However, passing $_GET values to .php pages is impossible with this, and that is what I need your help with.
I'm pretty new to mod_rewrite, and regular expressions in general, so this has become quite a problem to me. I'm pretty confident that this is possible - I'm just not good enough. Here is my unsuccessful attempt at doing this:
RewriteCond $1 !^(access\.php) RewriteRule ^(.*^\?)(\?(.*))*$ access.php?page=$1&$3 [L] To clarify, I'm attempting to turn http://url.com/index.php?test=something to http://url.com/access.php?page=index.php&test=something.
Thanks in advance for any help.
Unfortunately, that clarifies nothing. Rewrites cannot 'turn' something into something else, and your example is for two URLs. When there are two URLs involved, that's usually a redirect. A rewrite translates a URL Request into a Server-Internal Filepath, so the example would not mention two URLs. Additionally, for the URL that you would want users to 'see' and 'use' you would need to use that exact URL in the links within your site.
Take note of the notes in this thread... [webmasterworld.com...] especially post #3846403 and #3846577 there.
[edited by: g1smd at 12:39 am (utc) on Feb. 14, 2009]