cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Want Wordpress to handle errors, however get 403 from alias before redirect (NOT FILE PERMISSION)

I have a Wordpress site at example.com with an alias example.ca.  The .htaccess file used to redirect example ca to example.com looks something like:

 

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.ca$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.ca$
RewriteRule ^/?$ "http\:\/\/example\.com\/" [R=301,L]

 

Which is fine unless some junk is added to the %(REQUEST_URI) such as a directory or filname that doesn't exit in the public_html folder, for example example.ca/test. Rather than redirecting to the example.com folder and letting Wordpress hand the URI, it throws a 403 Forbidden error.  The invalid request example.com/test is handled correctly.

 

Have tried :

 

RewriteRule ^/?$ "http\:\/\/example\.com\/%{REQUEST_URI}" [R=301,L]

 

Sane exxor.

 

Any ideas?

 

It isn't a permission problem as the directory or file does not exist in the alias directory.