Basically, what I need to do is this: When someone types http://domain.tld/whatever.whenever it needs to rewrite to a page like this: check.php?query=whatever.whenever But this should exclude http://domain.tld/ and http://domain.tld/index.php Because in these cases index.php is displayed. Ive been trying for several hours and cant seem to get it work although Ive read many tutorials, and everything seems logical Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !^$ RewriteCond %{REQUEST_URI} !index\.php RewriteCond %{REQUEST_URI} !check\.php RewriteRule ^(.*)$ check.php?domain=$1 Code (markup):
Try with [L] at the end of each Rule (to stop looking for new rules). Example: Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^$ index.php [L] RewriteRule ^index\.php$ index.php [L] RewriteRule ^(.+)$ check.php?domain=$1 [L] Code (markup):