If your .htaccess redirects aren't working for specific directories, or a folder keeps redirecting to the wrong place, it may be caused by the nginx reverse proxy that runs in front of Apache on our servers. Nginx handles static files and caching, while Apache handles PHP and .htaccess rules. In some cases, nginx intercepts a request before Apache sees it, bypassing your .htaccess rules.
Your .htaccess Redirect May Be Bypassed by Nginx
Our servers use nginx as a reverse proxy in front of Apache. If a redirect isn't working:
- ✓ Static files (images, CSS, JS) are served by nginx, which doesn't read .htaccess
- ✓ PHP requests go through Apache, where .htaccess rules work normally
- ✓ Contact support if you need a redirect applied at the nginx level
01. How Nginx + Apache Work Together
Our servers run a dual-layer web server architecture:
- Nginx (front layer) - handles incoming connections, serves static files (images, CSS, JS, HTML), SSL termination, and caching
- Apache (back layer) - handles PHP processing, .htaccess rules, and dynamic content
When a visitor requests a page, nginx checks if the request is for a static file. If so, nginx serves it directly without involving Apache. If the request needs PHP processing, nginx passes it to Apache, which reads .htaccess and processes the request.
This is why .htaccess redirects work for PHP pages but may not work for static files or directory-level redirects.
02. Common Redirect Issues
Directory Redirect Not Working
If you have a redirect in .htaccess for a directory (e.g., /old-folder/ to /new-folder/) and the directory contains an index.html, nginx may serve the index.html directly without consulting Apache's .htaccess.
Subdomain or Folder Pointing to External Server
If you want a folder like yourdomain.com/app/ to proxy to a different server, .htaccess ProxyPass directives won't work on shared hosting. This requires server-level nginx configuration.
Redirect Loops
If both nginx and .htaccess try to redirect the same URL, you can get infinite redirect loops. This shows as a "too many redirects" error in the browser.
03. How to Fix
For PHP-Based Redirects (Most Cases)
If the redirect involves PHP pages (WordPress, etc.), .htaccess works normally. Make sure your redirect rules are correct using our .htaccess guide or redirect guide.
For Static File or Directory Redirects
If .htaccess redirects aren't being applied to static files or directory URLs, open a support ticket. We can add the redirect at the nginx level, which takes priority over everything.
For Redirect Loops
Check for conflicting redirects in:
- Your .htaccess file (may have duplicate or circular rules)
- cPanel > Domains > Force HTTPS Redirect (may conflict with .htaccess HTTPS redirect)
- WordPress Settings > General (site URL mismatch)
- Cloudflare (if using "Always Use HTTPS" on top of server-side redirect)
Need a Server-Level Redirect?
If your redirect requires nginx configuration, open a ticket with the source URL, destination URL, and redirect type (301 permanent or 302 temporary).
Open a Support TicketQuick Recap
- Nginx serves static files, Apache handles PHP - .htaccess only affects Apache requests
- PHP page redirects work in .htaccess - no changes needed
- Static file/directory redirects may need nginx config - contact support
- Redirect loops - check for conflicting rules in .htaccess, cPanel, WordPress, and Cloudflare
- ProxyPass not available - requires VPS or server-level configuration
Last updated March 2026 · Browse all htaccess articles · See also: .htaccess Guide | 302 Redirects
