Reputation: 450
i have a trivial question about htaccess rewrite condition. The think i want to do in my htaccess is:
When someone accesses my project from a url different from "example.com" to be redirected to a specific controller, for example app_user.php
I need the syntacs for this condition redirect.
Thanks for your time
Upvotes: 1
Views: 2890
Reputation: 786091
Try this code in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/app_user.php
RewriteRule ^ /app_user.php [L]
Upvotes: 3