Title: Solution for 404 errors with SSL requests
Last modified: August 21, 2016

---

# Solution for 404 errors with SSL requests

 *  [boxcarpress](https://wordpress.org/support/users/boxcarpress/)
 * (@boxcarpress)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/solution-for-404-errors-with-ssl-requests/)
 * If you find that this works:
    [http://www.example.com/custom-permalink/](http://www.example.com/custom-permalink/)
 * …but this doesn’t:
    [https://www.example.com/custom-permalink/](https://www.example.com/custom-permalink/)
 * Then perhaps this patch will help you:
    [https://gist.github.com/haroldkyle/5440567](https://gist.github.com/haroldkyle/5440567)
 * Hope that helps 🙂
    Harold
 * (Before applying this patch, I found that HTTPS requests returned a 404 error.
   The code as written uses get_option(‘home’) which always returns [http://](https://wordpress.org/support/topic/solution-for-404-errors-with-ssl-requests/?output_format=md),
   when we need to actually use home_url() to respect the protocol of the request.
   I don’t understand why the plugin author would bypasses home_url() in his code,
   but this patch doesn’t seem to introduce any problems editing/viewing the custom
   permalink pages.)
 * [http://wordpress.org/extend/plugins/custom-permalinks/](http://wordpress.org/extend/plugins/custom-permalinks/)

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

 *  Thread Starter [boxcarpress](https://wordpress.org/support/users/boxcarpress/)
 * (@boxcarpress)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/solution-for-404-errors-with-ssl-requests/#post-3684796)
 * I guess the plugin supports WP 2.6 or higher and the home_url() function only
   appears in 3.0 or later. So, this patch won’t work if you are pre-3.0.
 *  [Tradedog](https://wordpress.org/support/users/tradedog/)
 * (@tradedog)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/solution-for-404-errors-with-ssl-requests/#post-3684993)
 * Hi Harold, could you tell me how to install the patch.
 * I have tried editing the links but it gives me a garbled version of what my edit
   says. Will the patch help?
 * Many Thanks
 *  [aminland](https://wordpress.org/support/users/aminland/)
 * (@aminland)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/solution-for-404-errors-with-ssl-requests/#post-3684999)
 * Actually Harold I believe the only thing that needs to change is in the `custom_permalinks_original_`**`
   post`**`_link` function. That one is using `get_option('home')`, switching it
   to `get_home_url()` seems to work. It’s also why custom permalinked pages are
   working on SSL without this change, as the `custom_permalinks_original_`**`page`**`
   _link` function uses `get_home_url()` already. I guess it’s an oversight on the
   author’s part.
 * `get_home_url` is then defined later so that the old versions of wordpress will
   use the statically defined option `home` from the db.
 *  [aminland](https://wordpress.org/support/users/aminland/)
 * (@aminland)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/solution-for-404-errors-with-ssl-requests/#post-3685000)
 * [@tradedog](https://wordpress.org/support/users/tradedog/), you can edit the 
   file by going to /wp-admin/plugin-editor.php?plugin=custom-permalinks/custom-
   permalinks.php
 * Just follow my post above.

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

The topic ‘Solution for 404 errors with SSL requests’ is closed to new replies.

 * ![](https://ps.w.org/custom-permalinks/assets/icon.svg?rev=1785367)
 * [Custom Permalinks](https://wordpress.org/plugins/custom-permalinks/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-permalinks/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-permalinks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-permalinks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-permalinks/reviews/)

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [SSL](https://wordpress.org/support/topic-tag/ssl/)

 * 4 replies
 * 3 participants
 * Last reply from: [aminland](https://wordpress.org/support/users/aminland/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/solution-for-404-errors-with-ssl-requests/#post-3685000)
 * Status: not resolved