Title: permalinks and reverse proxy
Last modified: August 20, 2016

---

# permalinks and reverse proxy

 *  [lruellan](https://wordpress.org/support/users/lruellan/)
 * (@lruellan)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/permalinks-and-reverse-proxy/)
 * Hello,
 * I am trying to setup WordPress behind a reverse proxy.
    My wordpress installation
   resides at [http://blog.raileurope.com/development/](http://blog.raileurope.com/development/)
   I have setup a reverse proxy on the server [http://publicx.raileurope.com:8082](http://publicx.raileurope.com:8082)
   so that requests for [http://publicx.raileurope.com:8082/blog/](http://publicx.raileurope.com:8082/blog/)
   are forwarded to [http://blog.raileurope.com/development/](http://blog.raileurope.com/development/)
 * After my sysadmin enabled mod_proxy, everything worked fine, except all the URL
   generated in the blog pages were pointing to [http://blog.raileurope.com/development/](http://blog.raileurope.com/development/)(
   because wordpress uses absolute URL).
 * So I went ahead and added the following code to my wp-config.php
 *     ```
       if ( isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) {
       	define ('WP_HOME' , $_SERVER['HTTP_X_FORWARDED_HOST'] ) ;
       	define ('WP_SITEURL' , $_SERVER['HTTP_X_FORWARDED_HOST'] ) ;
       	$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'] ;
       }
       ```
   
 * This solved my initial problem, ensuring that the links were built correctly,
   showing the domain of my reverse proxy server ([http://publicx.raileurope.com:8082/blog](http://publicx.raileurope.com:8082/blog)),
   rather than the domain of the wordpress server ([http://blog.raileurope.com/development](http://blog.raileurope.com/development)).
   
   But a new problem occurred: all my blog pages accessed from the reverse proxy
   are giving me a 404 when permalinks are enabled. If I disable permalinks, the
   blog works fine from the reverse proxy.
 * So, I’m stuck – and I am at loss as to how to debug this.
    Any help would be 
   appreciated. Thank you.
 * Lothaire

Viewing 1 replies (of 1 total)

 *  [tvanyo](https://wordpress.org/support/users/tvanyo/)
 * (@tvanyo)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/permalinks-and-reverse-proxy/#post-2364311)
 * Off Topic and sorry I cant help you quite yet…I have made multiple pages and 
   have hit published yet they don’t appear on the webpage. There is no link to 
   go see these new pages. What am I doing wrong? Sorry to tease with a response
   about something so little
 * Thanks

Viewing 1 replies (of 1 total)

The topic ‘permalinks and reverse proxy’ is closed to new replies.

## Tags

 * [permalinks](https://wordpress.org/support/topic-tag/permalinks/)
 * [reverse proxy](https://wordpress.org/support/topic-tag/reverse-proxy/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [tvanyo](https://wordpress.org/support/users/tvanyo/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/permalinks-and-reverse-proxy/#post-2364311)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
