I have the following .htaccess file
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [L]
RewriteRule ^constant?([^/]+)=([^/]+) /index.php?url=constant&type=$1&task=$2 [L]
The last line isn't quite working or is being affected by the previous.
If $_GET['url'] doens't exist in DB it fires 404.
contan?x=y //gives 404
constant?x=y //works
That is how it shoud work.
However, when I use var_dump($_GET); on line 1 of index at example.com/constant?x=y
I only get array(1) { ["url"]=> string(8) "constant" }
Is the last line being affected by the previous, could someone point me in the right direction?
RewriteRule ^constant?([^/]+)=([^/]+)does not make much sense for me -- it's wrong. Could you please tell how would you like to rewrite that URL (from URL => to URL) and I will do the rule for you. Also -- you are saying:{ ["url"]=> string(8) "constant" }-- that is correct. If not -- what do you expect there?{ ["url"]=> string(8) "constant", ["type"]=>..., ["task"]=>..., }. You're right about theRewriteRuleI was trying to make a very simple url so :example.com/index.php?a=x&b=y&c=ztoexample.com/x?y=z. Which is misusing?and=. The server see it as$_GET['y'] == z. Is something like this achievable? Or as simple? Thanks.