Forum Moderators: phranque
So I want a request like:
[domain.com...]
to be changed to:
[domain.com...]
so I figured it would be enough to:
RewriteBase /
RewriteRule /(.*) /index.php?q=$1
but I was wrong. Am I crazy?
Where are you placing this code, in httpd.conf or in .htaccess? The syntax is subtly different, in that leading slashes are stripped from the URI seen by RewriteRule in the .htaccess context.
Therfore, you may need to delete the leading slash for use in .htaccess:
RewriteRule (.*) /index.php?q=$1
Options +FollowSymLinks
RewriteEngine on
Other than that, you've got most of it.
One warning: make sure that your script will NOT return a 200-OK and content for all possible requested URIs... If you do not return 404 under any circumstances, then search engines will see your site as a spider trap - an infinite URI-space where a spider might follow links forever. Therefore, they set an artificially-low depth of spidering on such sites, and you won't easily get all your pages indexed. Some basic syntax-checking and URI-validity checking of URIs before returning content will usually suffice.
Jim