Domain Specific Rewrite Rules
Add Nginx rewrite rules for domains
You can include custom rewrite rules as follows:
If your domain name is foo.com, see below to add a rewrite rule
- For HTTP domain: Create a file /usr/local/nginx/conf/vhost.d/foo.com.rewrite
- For HTTPS domain: create a file /usr/local/nginx/conf/vhost.ssl.d/foo.com.rewrite
After that, rebuild the vhost configuration using nginxctl as follows
nginxctl rebuildvhost foo.com
It is recommended to avoid rewrite rules in .htaccess and use nginx rules.