Last updated: October 12, 2026
Some links on this page are affiliate links. If you sign up through them I may earn a commission at no extra cost to you.
I’m a big fan of the Redirection plugin, and it’s what this site uses for most of its redirects. Sometimes, though, you want a redirect to happen at the hosting level, before WordPress even loads. On Pressable that takes a little more work than on some other hosts.
The short answer
Pressable doesn’t have a redirect manager in the MyPressable Control Panel, and because its servers run NGINX, rules in an .htaccess file are ignored. Instead, Pressable has you create a PHP file called custom-redirects.php in the root of your site. Pressable runs that file early, before its Batcache page cache, so your redirects fire even for cached pages.
How to add custom-redirects.php
- Connect to your site with SFTP or SSH. Your credentials are on the site’s Overview tab in MyPressable.
- In the web root (
htdocs), create a file namedcustom-redirects.php. - Start the file with an opening
<?phptag, then add your redirect rules. - Save it and test the old URL in a private browser window.
Here’s the basic single-page example, adapted from Pressable’s guide:
<?php
if ( $_SERVER['REQUEST_URI'] == '/old-page' ) {
header( 'HTTP/1.1 301 Moved Permanently' );
header( 'Location: /new-page' );
exit;
}
Because it’s just PHP, you can go further than one-to-one matches. This version moves a whole folder and keeps the rest of the path:
<?php
if ( preg_match( '#^/old-blog(/.*)?$#', $_SERVER['REQUEST_URI'], $m ) ) {
header( 'Location: /blog' . ( isset( $m[1] ) ? $m[1] : '/' ), true, 301 );
exit;
}
And this one sends an old domain that’s parked on the same site to your main domain:
<?php
if ( $_SERVER['HTTP_HOST'] === 'old-domain.com' ) {
header( 'Location: https://www.new-domain.com' . $_SERVER['REQUEST_URI'], true, 301 );
exit;
}
Gotchas
- Real files win. NGINX serves a file that physically exists before PHP runs, so you can’t redirect away from a PDF or image that is still on the server. Delete or rename the file first.
- Lightweight 404s. If a redirect for a missing image or file never fires, check Settings > Performance in MyPressable. With Lightweight 404s on, some static file requests get a 404 before PHP loads.
- A typo breaks the site. This file runs on every request, so a PHP syntax error takes everything down. Keep a copy of the last working version and test right after you upload.
- Use 301 for permanent moves. Use 302 only when the old URL is coming back.
custom-redirects.php or a plugin?
| custom-redirects.php | Redirection plugin | |
|---|---|---|
| Runs before WordPress | Yes | No |
| Edit without SFTP | No | Yes |
| Regex support | Yes (PHP) | Yes |
| 404 logging | No | Yes |
| Best for | Domain moves, high-traffic URLs | Day-to-day content changes |
My rule of thumb: domain-level and bulk structural redirects go in custom-redirects.php. Everything else goes in Redirection, where non-developers can manage it and you get a log of the 404s you still need to fix.
Not on Pressable yet? Staging, backups, a CDN, and Jetpack Security come with every plan. Plans start at $250 a year.
FAQ
Does Pressable support .htaccess redirects?
No. Pressable runs NGINX, which ignores .htaccess files. Use a custom-redirects.php file in your web root or a redirect plugin instead.
Where does custom-redirects.php go on Pressable?
In the site’s web root, the htdocs folder, next to wp-config.php. Upload it with SFTP or create it over SSH.
Why isn’t my Pressable redirect working?
The most common causes are a file that still exists at the old path, Lightweight 404s blocking a static file request, or a mismatch in the REQUEST_URI string such as a trailing slash.