Title: redirection
Last modified: August 30, 2016

---

# redirection

 *  Resolved [ebeighe](https://wordpress.org/support/users/ebeighe/)
 * (@ebeighe)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/redirection-28/)
 * If i put a file into my blog’s root called abc.html
    I can access it as expected.
 * However, if i put a file called abc.php
    I cannot access it, and instead get 
   redirected to my blog’s generic file not found page.
 * How does that work?
 * In a somewhat related question:
    I used to have my blog in the subfolder blog,
   and have permalinks with post name. I recently moved everything up to the root
   of my domain… so an example link might be mydomain.com/a-post-name It’s pretty
   clever, but I’m wondering why does the old link still work? mydomain.com/blog/
   a-post-name

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [bemdesign](https://wordpress.org/support/users/bemdesign/)
 * (@bemdesign)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/redirection-28/#post-6606248)
 * WordPress, on Apache servers, generates an .htaccess file that basically tells
   Apache to capture all requests for php files and direct them to WordPress to 
   act on. So if that PHP file is actually not a part of WordPress, WordPress will
   try and execute it and fail as it’s not following WordPress’ API. To work around
   this, you can either put WordPress (and its .htaccess file) in its own subdirectory
   so that your custom PHP files aren’t in the same directory as WordPress. Or you
   can create a custom rewrite via the .htaccess file to basically tell the server
   to not go to WordPress to act on that particular file.
 * As to your 2nd related question, this is, again, likely due to the .htaccess 
   file (normally invisible – use an FTP program or set your control panel options
   to see invisible files to view). And WordPress is smart enough that if a request
   name is close enough to an existing post, it will show that post.
 *  Thread Starter [ebeighe](https://wordpress.org/support/users/ebeighe/)
 * (@ebeighe)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/redirection-28/#post-6606391)
 * ah, of course, the .htaccess file is involved with permalinks. I knew that (but
   forgot)! Thanks.
 *  Thread Starter [ebeighe](https://wordpress.org/support/users/ebeighe/)
 * (@ebeighe)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/redirection-28/#post-6606392)
 * marked resolved

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘redirection’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [ebeighe](https://wordpress.org/support/users/ebeighe/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/redirection-28/#post-6606392)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
