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.

I want to redirect /na to the /na.php

So, I wrote like following in .htaccess. I don't want to create wordpress page for /na. Just want to redirect.

But it's not working and always show 404 error.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^na$ [NC]
RewriteRule . /index.php [L]

RewriteCond %{REQUEST_URI} ^na$ [NC]
RewriteRule . /na.php [L]
</IfModule>
# END WordPress
share|improve this question

1 Answer 1

up vote 1 down vote accepted

To rewrite from na to na.php it should be

# BEGIN WordPress
<IfModule mod_rewrite.c>

    RewriteCond %{REQUEST_URI} ^na$ [NC]
    RewriteRule ^na$ /na.php [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

Regards

share|improve this answer

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.