I'm redesigning a site and converting to wordpress. I want to redirect the old pages to the new ones.

Also, wordpress is installed in a directory, but viewable as if it was in the root.

So the following htaccess actually works, but I want to change the top line so that it catches all the pages in the root and redirects them to the proper place

Redirect 302 /PAGENAME.php http://www.example.com/PAGENAME

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

# END WordPress

Try replacing your line with this

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
  • tried, it didn't do anything
    – trundles
    May 22 '15 at 16:57
  • Hmm well that takes any domain/$.php to domain/$ Is this an apache host? May 23 '15 at 8:37
  • sorry, I thought I replied to this but I guess it didn't go through. Yes, it is apache
    – trundles
    May 26 '15 at 17:26
  • Ok since my brain isn't working this morning, have you tried the redirection plugin? wordpress.org/plugins/redirection May 27 '15 at 0:37

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.