user225269
user225269

Reputation: 10913

htaccess file not working for wordpress pages

I'm trying to add a new rule in the htaccess file that will allow input of other instead of the actual name of the page which is notify. But I can't seem to get it to work.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^other$ notify [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Also tried something like:

RewriteRule ^other$ index.php/notify [QSA]

and this:

RewriteRule ^other$ /index.php/notify [QSA]

Also tried adding the rules from wordpress itself (inside the admin_init section of a plugin) and then refresh the rules by going to the permalinks settings, choosing post name and then save but no luck either. Upon checking htaccess file it produced a rule similar to the above one:

add_rewrite_rule('other', 'index.php/notify', 'bottom');

I've verified that I can override the rules via the htaccess file in the root directory because when I tried to use an actual file in the server hello.php

RewriteRule ^other$ hello.php [QSA]

It works. I just don't know why when I use a wordpress page it doesn't work. It also seems to work when I use the absolute path:

RewriteRule ^other$ http://somesite.com/notify [QSA]

But this is no good because when I add some arguments to the URL (which is what I will ultimately do) I end up with bad looking URL when I do the above: http://somesite.com/?some_argument=some_value

The current permalink setting in wordpress is set to post name. Any ideas what I have missed?

Upvotes: 0

Views: 637

Answers (2)

Ronald Joseph
Ronald Joseph

Reputation: 45

Hello may be you can use .htaccess plugin..! to control it from admin panel. I hope this Help you

http://wordpress.org/plugins/wp-htaccess-control/

Upvotes: 1

Igor Evstratov
Igor Evstratov

Reputation: 719

Try this rule:

RewriteRule ^other/?$ index.php?p=PAGE_ID [QSA]

Put the necessary PAGE_ID to redirect to

Upvotes: 3

Related Questions