I'm trying to get my .htaccess
file to forward all URLs to a single page with url parameters so that I can handle the page retrievals that way. What I want to happen is this: say the user types in http://mysite.com/users/dan
it should forward to the page http://mysite.com/index.php?url=/users/dan
.
Similarly, if the user accessed the URL http://mysite.com/random-link
it should forward to http://mysite.com/index.php?url=random-link
Here is the code I tried in my .htaccess
file, but it just keeps throwing a 500 error at me:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond % (REQUEST_FILENAME) !-f
RewriteRule (.*)$ index.php?url=$1 <QSA,L>
</IfModule>
I UPDATED MY CODE TO THIS AND IT STILL THROWS A 500 ERROR I changed the < and > to [ and ] and I removed the space after the % in the RewriteCond, but it still throws an error.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*)$ index.php?url=$1 [QSA,L]
</IfModule>
I'm a novice when it comes to .htaccess
, so any help would be greatly appreciated, because I don't know what's causing the server to timeout.