Redirect old wordpress site pages to new php site urls using .htaccess

  1. I had a website ‘example.com’, which was in wordpress initially but i had to move it to php.
  2. Now my site is in php. The problem now is, i tried redirecting urls, for ex:-http://www.example.com/about-mysite/, to my new url using Redirect 301 in .htaccess file.

  3. Suppose my old page is /about-example/, i redirect it as,

    Read More
    Redirect 301 /about-mysite/ http://www.example.com/about-example.php
    

but it is not getting redirected.

Related posts

1 comment

  1. Have this redirect rule right at top of your .htaccess before WP rules:

    Options -MultiViews
    RewriteEngine On
    
    RewriteRule ^(about-kankaria-eye-hospital)/?$ /$1.php [L,NC,R=301]
    

    Suggested generic redirect rule:

    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^([^.]+)/?$ /$1.php [L,NC,R=301]
    

Comments are closed.