• ranell

    (@ranell)


    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)
  • Try putting your rules immediately after the RewriteBase line.

    Thread Starter ranell

    (@ranell)

    does not work 🙁

    Ok. Can you explain what you are trying to do?

    Thread Starter ranell

    (@ranell)

    ‘im trying to transform my url

    for my pages:

    http://www.mysite.com/?p=111
    to
    http://www.mysite.com/111/

    for my category:

    http://www.mysite.com/?cat=1&catname=games
    to
    http://www.mysite.com/1/games

    i don’t wanna to use options/permalinks, it is possible with htaccess?

    thanks!

    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

    (@ranell)

    permalink options break many link, i don’t understand why, in addition the link of category is
    fixed: http://www.mysite.com/category/nameoofcategory

    I find that it’s “ugly” 🙁

    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

    (@ranell)

    changing category base, it’s seems that it’s not possible?

    Thread Starter ranell

    (@ranell)

    The new question:

    It is possible to add a new rewrite rules in my htacess?

    thanks

    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

    (@ranell)

    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.