I'm kinda training my htacces+regex skills, been studying in theory for like a month or two, and wanted to give it a shot in practice.
So the thing is I have a file called index.php with the following code:
<html>
<head>
</head>
<body>
<a href="2var.php?var1=one&var2=two">2var test</a><!--2var.php/one/two-->
</body>
</html>
and a second file called 2var.php that has the following code:
<?php
if($_GET["var1"] && $_GET["var2"])
{
echo "both rechead";
}
else
{
if($_GET["var1"] || $_GET["var2"])
echo "one of them reached";
else
echo "neither reached";
}
?>
So, what I wanted to do is to test if I can send variables and edit the url at the same time(I've been reading that is possible and that's exactly what's happening "behind the curtains"). But I can't get the right mind-set or the knowhow to accomplish this.
Btw, htacces:
DirectoryIndex index.html index.php
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^\/?([a-z]+)\/([a-z]+).html$ 2var.php?var1=$1&var2=$2
My point is to do this 2var.php/one/two and that the variables are actually passed. Now I recieve only "neither reached";
EDIT: I'm in localhost so the hole link is localhost/tests/index.php || localhost/tests/var2.php?var1=$1&var2=$2
My point is to do this 2var.php/one/twowhat you wrote is for/one/two.htmlone/two.html. Don't create the href with the $_GET's