Reputation: 67
I'm trying to rewrite www.domain.com/something/some/ to www.domain.com/index.php?q=something/some/
This is what I have so far:
RewriteCond %{REQUEST_FILENAME} ([a-z-]+)/?$
RewriteRule (.*) index.php?q=$1 [QSA,L]
But I want to exclude urls like these: www.domain.com/#!/something
Could you please help?
Thanks, John
Upvotes: 1
Views: 219
Reputation: 785551
You can use this rule in root .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?q=$1 [QSA,L]
Use of .+
also takes care of /#!/something
since Apache will only get /
for that as text after #
doesn't reach web server.
Upvotes: 2