1

the WordPress rewrite rules are like this:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

now i would like to add a new rule that would deliver for the url /test the same content as the root page, but without doing an actual redirect.

i have tried:

RewriteRule ^test/$ /index.php [PT]

but that does seem to give test as a parameter to index.php, since i get a page not found error.

1 Answer 1

2

There's nothing wrong with your new rule. Are you trying to access 'whatever.com/test/' or are you trying to do 'whatever.com/test/whatever'?

The rule you have will only match for 'whatever.com/test/' and not 'whatever.com/test/index.html'.

If you wanted it to do all, then change it to:

RewriteRule ^test/$ /index.php [PT]
RewriteRule ^test/.*$ /index.php [PT]
1
  • i am trying to access /test/. it seems it works if i specify another file like a.php, but not with index.php. i guess it is a WordPress problem.
    – memical
    Jul 31, 2012 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.