I just published a completely revised version of a website (static site to a Wordpress powered one) without changing the domain or the web server. In the old site the URL structure was example.com/product_category1.phpexample.com/product1.phpand in the current one it is:example.com/product_category1/example.com/product_category1/product1/so now it's more logical and without .php extensions. Now, if I do a Google search e.g. for product category 1, example.com/product_category1.php ranks higher than example.com/product_category1. I solved this by applying a 301 redirect from the GUI offered by my web hosting company, so now example.com/product_category1.php redirects to example.com/product_category1/. I noticed that I have to keep product_category1.php file in the public_html folder in order for the redirection to happen, otherwise the only redirection that happens is to the 404 page.I'd like the example.com/product_category1.php and other .php extended URLs to vanish from the search results. Will they do so if they always get redirected, even though they still exist in the public_html folder? Is there a way to do the redirection without keeping the files? Or should this be dealt in a completely different manner in order to have maximum SEO and visibility for correct URLs in the new website?
Implementing 301 redirects won't work without an existing file. Will that matter to Google or is there a better way to implement redirects?
seo;google search;url;301 redirect;indexing