Title: Rewriting Custom post type
Last modified: August 20, 2016

---

# Rewriting Custom post type

 *  [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/rewriting-custom-post-type/)
 * I have all my posts in this format /gallery/%postname%, where ‘gallery’ is my
   custom post type, but i want to change it to /media/gallery/%postname%, and make
   sure that all my current posts still get me to the same page as they did before
   without a Not Found error.
 * I tried `'rewrite' => array("slug" => "/media/gallery"),`
 * but all the posts lead me to Not Found page.
 * Help please 🙂

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

 *  [Shaan](https://wordpress.org/support/users/munny1/)
 * (@munny1)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/rewriting-custom-post-type/#post-2670008)
 * See this:
    [http://codex.wordpress.org/Using_Permalinks](http://codex.wordpress.org/Using_Permalinks)
 *  Thread Starter [prempwp](https://wordpress.org/support/users/prempwp/)
 * (@prempwp)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/rewriting-custom-post-type/#post-2670288)
 * well, tried reading it, but couldn’t figure out. Please help.

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

The topic ‘Rewriting Custom post type’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [prempwp](https://wordpress.org/support/users/prempwp/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/rewriting-custom-post-type/#post-2670288)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
