Here's my current htaccess code:
RewriteEngine On
RewriteRule ^([^/]+)/([^/]+)$ index.php?apikey=$1&url=$2
RewriteRule ^([^/]+)/([^/]+)/$ index.php?apikey=$1&url=$2
When I go to http://example.com/testing/google.com
it works like I want it to.
I use this PHP code:
<?php echo $_GET['apikey']; ?> - <?php echo $_GET['url']; ?>
And I get this:
testing - google.com
That just how I want it. But I'm running into issues when there's special characters in the second parameter (they will never be in the first). For example, I tried this:
http://example.com/testing/http://www.google.com/?test#again%%notworking
That should be displaying this on my page:
testing - http://www.google.com/?test#again%%notworking
But instead I'm getting a 404 error. Is this possible to do with just my htaccess or do I need to change something in the PHP?
EDIT:
In case this helps to know, the first parameter will always be lower case letters and numbers. It is also 32 characters long.