How to redirect URL in wordpress

I created my website using PHP before so that all the page urls extensions are ended up with php extension like www.example.com/about-us.php and I shared that urls in some other places.

But now I am creating that site in wordpress so all the urls are like www.example.com/about-us

Read More

Now how can I redirect www.example.com/about-us.php to www.example.com/about-us

Related posts

Leave a Reply

2 comments

  1. You can place this rule just below RewriteBase line in WP’s .htaccess file to redirect .php links:

    RewriteCond %{THE_REQUEST} s/+(?:index)?(.*?).php[s?] [NC]
    RewriteRule !(^|/)wp-login.php$ /%1 [R=301,L,NC,NE]
    
  2. You can also do like,goto admin panel and click on permalinks under settings.Then you notice options for Url settings.As per your need you need to select Post name and then your all URLs will like as your deserve(www.example.com/about-us)