So I have a wordpress blog based in the root folder /. Besides that I have a sub domain in a subfolder. I want to do url rewriting in this subfolder (it’s done in php with a 404 redirection rule in a .htaccess file). The redirection of the .htaccess is supposed to redirect to /subfolder/index.php .
My problem is that it doesn’t work once it’s uploaded on the server. The url http://mywebsite.com/subfolder/the-file-im-lookingfor.html keeps redirecting to the 404 error page of my wordpress blog.
I guess this is because of the url rewriting of WordPress. Is there any way I can solve that?
Thanks in advance!
If you have a 404 redirection rule, i.e. a flag in your htaccess that looks like this:
Then you are sending the browser a 404 HTTP response, so it definitely will send the browser to your 404 page. You may have meant to send a 301 redirect.
The way I would handle a subdomain is to set up virtual hosts in your httpd.conf file and set the DocumentRoot to /subfolder for the subdomain. Then, you can handle their rewrite rules separately by putting separate htaccess files in each folder.