This is an expansion on the second answer to the question asked here.

I have been trying to redirect a post request from my_website/test to wp-content/themes/my_theme/test.php but I am getting a 404 whenever I try to send it.

I have a .htaccess file in /wordpress with the contents

#BEGIN WordPress

Redirect 301 /test_redirect wp-content/themes/my_theme/test.php

#END WordPress

Is the htaccess file being used by wordpress or apache? Do I need any special configurations on either to allow them?

I saw somewhere that to allow .htaccess files you just need to change apache2.conf from AllowOveride none to all for and Directory /var/www/>, is this the only setting I need to change?

I also saw that having proxypass enabled might interfere with the redirect, is this true? Is there a way to get around that if it is?


Thanks to Jorin for the help with solving this problem.

I changed the location of the .htaccess file down to www instead of www/wordpress and changed the address of the php file I wanted to redirect to to the full link i.e.


And that redirect worked!


I think the problem is in the redirect. Can you try:

Redirect 301 /test_redirect http://www.yoursite.com/wp-content/themes/my_theme/test.php
  • That doesn't look like it changed anything. Do you know if there is a log file that might show any errors associated with the htaccess file? – Phenom588 Mar 12 '16 at 18:42
  • I don't think there is a log file for htaccess. If you go in your browser to /test_redirect where does it lead you to? – Jorin van Vilsteren Mar 12 '16 at 18:44
  • That's where I've been checking so far, it just leads to a 404 page. – Phenom588 Mar 12 '16 at 18:46
  • But what is the url of the 404 page? – Jorin van Vilsteren Mar 12 '16 at 18:46
  • Still just my_website/test_redirect – Phenom588 Mar 12 '16 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.