Title: .htaccess permalinks redirect
Last modified: August 30, 2016

---

# .htaccess permalinks redirect

 *  Resolved [CirceTheHouseCat](https://wordpress.org/support/users/circethehousecat/)
 * (@circethehousecat)
 * [11 years ago](https://wordpress.org/support/topic/htaccess-permalinks-redirect/)
 * Hello,
 * I’ve read many threads on the support forum but can’t find any where someone 
   explain how to do what I’d like to do.
 * I have a permalinks structure for my post which is domain/post (%postname%) and
   I would like to change it to domain/category/post /%category%/%postname%).
 * I’ve undestand that after changing the permalinks structure in WordPress I’ll
   have to set redirection in the .htaccess file, but I have no clue how to do that.
 * Can anyone help me please?
 * Thanks

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

 *  [pedger](https://wordpress.org/support/users/pedger/)
 * (@pedger)
 * [11 years ago](https://wordpress.org/support/topic/htaccess-permalinks-redirect/#post-6399720)
 * Hi
 * There is a lot of info on [https://codex.wordpress.org/Using_Permalinks](https://codex.wordpress.org/Using_Permalinks)
   page
 * You can focus on “Automatically updating .htaccess” if you want, since it may
   automatize your process.
 * I hope that helps.
 * If you have more questions, please reply
 *  Thread Starter [CirceTheHouseCat](https://wordpress.org/support/users/circethehousecat/)
 * (@circethehousecat)
 * [11 years ago](https://wordpress.org/support/topic/htaccess-permalinks-redirect/#post-6399722)
 * Hi pedger,
 * thanks for the answer, but unfortunately I am not a tech guy… I am more a “copy/
   paste solution user”…
 * I’ve seen in many threads how people explain how to do to the opposite I ask (
   going from %category%/%postname% to %postname%) and give some rewrite rules that
   should be added to the .htaccess file, so I am more looking forsomething like
   that or an easy alternative I can apply.
 * I have close to 0 knowledge of php and a blog with more than 2000 posts that 
   now gives 404 errors for the %postname% permalinks… :/
 * I can do the redirect manually using a redirect plugin, but it ask to add each
   post url I want to redirect and it will take me ages.
 *  [pedger](https://wordpress.org/support/users/pedger/)
 * (@pedger)
 * [11 years ago](https://wordpress.org/support/topic/htaccess-permalinks-redirect/#post-6399727)
 * well… can you paste here the contents of your .htaccess? please do it with the“
   code” tag above the editor.
 * Here, mine looks like this:
 *     ```
       Options +FollowSymLinks -SymLinksIfOwnerMatch
   
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /wp-raw/
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /wp-raw/index.php [L]
       </IfModule>
   
       # END WordPress
       ```
   
 * Also, do you know what kind of webserver are you using? Apache? Nginx? This is
   important because to make custom permalinks work, you have to setup the webserver
   to accept this kind of redirects.
 * For now, you can use the default permalink (that one that looks like [http://YOURSITEHERE/?p=123](http://YOURSITEHERE/?p=123))
   and your blog should work again.
 *  Thread Starter [CirceTheHouseCat](https://wordpress.org/support/users/circethehousecat/)
 * (@circethehousecat)
 * [11 years ago](https://wordpress.org/support/topic/htaccess-permalinks-redirect/#post-6399733)
 * Hello again and thank you for your time.
 * Here’s how the .htaccess of my site looks like
 * AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xhtml
   +xml
    AddOutputFilterByType DEFLATE application/x-javascript application/javascript
   text/javascript text/css
 * <FilesMatch “.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”>
    ExpiresActive On 
   ExpiresDefault “access plus 1 year” </FilesMatch>
 * Header unset ETag
    FileETag None
 * # BEGIN WordPress
    <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule
   ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}!-
   d RewriteRule . /index.php [L] </IfModule>
 * # END WordPress
 * The webserver is Apache (I assume it’s Apache, the site is hosted in Bluehost).
 * As for the redirection. I like the new permalinks structure I have with /category/
   post. My problem now is how to fix the redirection for the old one (/post), that
   now gives 404 errors.
 * Thanks
 *  Thread Starter [CirceTheHouseCat](https://wordpress.org/support/users/circethehousecat/)
 * (@circethehousecat)
 * [11 years ago](https://wordpress.org/support/topic/htaccess-permalinks-redirect/#post-6399864)
 * Anyone? 🙂 I am still trying to figure out how to apply the redirection in my.
   htaccess from:
 * domain/%postname%
 * to:
 * domain/%category%/%postname%
 * Thanks
 *  Thread Starter [CirceTheHouseCat](https://wordpress.org/support/users/circethehousecat/)
 * (@circethehousecat)
 * [11 years ago](https://wordpress.org/support/topic/htaccess-permalinks-redirect/#post-6399876)
 * Fixed with this plugin: [https://wordpress.org/plugins/permalinks-to-categorypermalinks/](https://wordpress.org/plugins/permalinks-to-categorypermalinks/)

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

The topic ‘.htaccess permalinks redirect’ is closed to new replies.

## Tags

 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [CirceTheHouseCat](https://wordpress.org/support/users/circethehousecat/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/htaccess-permalinks-redirect/#post-6399876)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
