Member Avatar for Aardwolf

I have this rewrite setting:

RewriteRule ^([a-zA-Z0-9_'-]+)$ /index.php?action=$1

but now I need for example to return an error to a register page by $_GET

/?action=register&error=1

but with the rewrite rule I can't get a PHP script to work with this URL:

/register&error=1

What rewrite rule do I need to make this work?

Sorry, it's not getting me.

Member Avatar for diafol
/register&error=1

Is this a valid URL? Don't you mean...

/register?error=1
Member Avatar for Aardwolf

Yea something like that, but the rewrite module doesn't rewrite it like ?action=register&error=1

Member Avatar for diafol

I'm confused.
1) How do you want the url to appear in your address bar? (/register/error/1/ ??)
2) What is the actual underlying url (I'm assuming ?action=register&error=1)

Member Avatar for Aardwolf

the url is supposed to look something like:
/register?error=0
no .php, when rewritten, it'll outcome this:
/?action=register&error=0

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.