Title: [htaccess]rewrite rules does not work
Last modified: August 20, 2016

---

# [htaccess]rewrite rules does not work

 *  [ranell](https://wordpress.org/support/users/ranell/)
 * (@ranell)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/)
 * Hello all,
 * i’m trying to add rewrite rules to my htacess (in bold)
 * # BEGIN WordPress
    <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /home/
   mysite/public_html/www
 * RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d RewriteRule./
   index.php [L]
 * **RewriteCond %{QUERY_STRING} ^p=([0-9]\*)$
    RewriteRule ^index\.php$ /%1/? [
   R=301,L]
 * </IfModule>
    # END WordPress
 * this does not work, there are a special way to define htaccess in wordpress?
 * thanks!

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

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127354)
 * Try putting your rules immediately after the RewriteBase line.
 *  Thread Starter [ranell](https://wordpress.org/support/users/ranell/)
 * (@ranell)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127399)
 * does not work 🙁
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127406)
 * Ok. Can you explain what you are trying to do?
 *  Thread Starter [ranell](https://wordpress.org/support/users/ranell/)
 * (@ranell)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127409)
 * ‘im trying to transform my url
 * for my pages:
 * [http://www.mysite.com/?p=111](http://www.mysite.com/?p=111)
    to [http://www.mysite.com/111/](http://www.mysite.com/111/)
 * for my category:
 * [http://www.mysite.com/?cat=1&catname=games](http://www.mysite.com/?cat=1&catname=games)
   
   to [http://www.mysite.com/1/games](http://www.mysite.com/1/games)
 * i don’t wanna to use options/permalinks, it is possible with htaccess?
 * thanks!
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127413)
 * > i don’t wanna to use options/permalinks, it is possible with htaccess?
 * hmmm… it should be possible to change the url with htaccess alone but you are
   subverting a big chunk of WordPress. I’d expect a lot of things to break. Why
   do you not want to use permalinks?
 *  Thread Starter [ranell](https://wordpress.org/support/users/ranell/)
 * (@ranell)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127414)
 * permalink options break many link, i don’t understand why, in addition the link
   of category is
    fixed: [http://www.mysite.com/category/nameoofcategory](http://www.mysite.com/category/nameoofcategory)
 * I find that it’s “ugly” 🙁
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127417)
 * You can change the category base to something else from the Settings->Permalinks
   panel. At any rate, I think your chosen solution is going to cause more problems
   than it solves.
 * I’d suggest that you figure out why the permalinks break your existing links.
   Have you hard coded a lot of links maybe? And then work within the rewrite system
   to get what you want.
 *  Thread Starter [ranell](https://wordpress.org/support/users/ranell/)
 * (@ranell)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127427)
 * changing category base, it’s seems that it’s not possible?
 *  Thread Starter [ranell](https://wordpress.org/support/users/ranell/)
 * (@ranell)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127454)
 * The new question:
 * It is possible to add a new rewrite rules in my htacess?
 * thanks
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127455)
 * Yes. It is possible. I’ve got some custom rules in one of mine. You can do it.
   You just need to be careful not to screw up anything that WordPress needs.
 *  Thread Starter [ranell](https://wordpress.org/support/users/ranell/)
 * (@ranell)
 * [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127467)
 * i’ve tried this, that’s work, but i have not my $_GET[‘cat’] 🙁
 * RewriteCond %{QUERY_STRING} ^cat=([0-9]*)$
    RewriteRule ^index\.php$ /cat/%1/?[
   R=301,L]
 * i need the $_GET[‘cat’] for my query post.
 * thanks

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

The topic ‘[htaccess]rewrite rules does not work’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 11 replies
 * 2 participants
 * Last reply from: [ranell](https://wordpress.org/support/users/ranell/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/htaccessrewrite-rules-does-not-work/#post-2127467)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
