I'm trying to build a url shortener, and I want to be able to take any characters immediately after the domain and have them passed as a variable url. So for example
- http://google.com/asdf
would become
- http://www.google.com/?url=asdf.
Here's what I have for mod_rewrite right now, but I keep getting a 400 Bad Request:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?url=$1 [L,QSA]
Try replacing
^(.*)
with^(.*)$
Edit: Try replacing
index.php
with/index.php