Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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]
share|improve this answer
    
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 '12 at 21:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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