If the old .php URLs and the extensionless URLs serve the same content, and the site has decided to switch permanently to extensionless URLs, the recommended approach is to use a 301 redirect from each old URL to its corresponding new URL. If visitors still need to access the same content directly at both URLs, a canonical tag is appropriate for identifying the preferred version. The two work differently: a 301 redirect takes visitors to the new URL, while a canonical tag identifies the URL you want search engines to use without redirecting visitors. This approach is supported by the supplied public discussions, but it does not guarantee that Google will immediately remove the old URLs from its index.
First, decide whether the page is moving permanently or needs to remain accessible at multiple URLs
What matters is not whether a URL ends in .php, but how the old and new URLs relate to each other. In this case, visitors following old external links can still open the same pages. The next question is whether visitors still need to view the content directly at the old URLs.
- A permanent URL change for the same page: Moving from /about.php to /about, with no need to keep both versions directly accessible, is the kind of situation in which the discussions recommend a 301 redirect.
- The same content must be available at multiple URLs: A canonical tag can identify the single URL you want Google to use.
- The old and new pages contain different content: This falls outside the question’s premise of identical content, so the conclusions above cannot be applied directly.
A 301 redirect takes visitors to the new URL and tells search engines the page has moved
The public discussions describe a 301 redirect as a notice that a page has moved permanently. Visitors following an old link are taken to the new page, and search engines can use the redirect to understand the relationship between the old and new URLs. For example, if /about has replaced /about.php, a redirect reflects that decision rather than leaving the same content directly accessible at both URLs.
Several answers also mention that the value of links to the old page can pass to the new URL. However, these discussions provide no verifiable transfer percentage, ranking outcome, or timeline for index updates. They therefore offer no basis for guaranteeing that rankings will remain unchanged after setup or that the old URL will immediately disappear from the index.
Canonical tags allow multiple URLs to remain accessible, but opinions differ on using them with 301 redirects
If redirecting is not possible or is not planned, these discussions specifically recommend considering canonical tags. One example is a page accessible through both index.php and a URL containing a ref parameter. A canonical tag can identify the preferred URL while visitors continue to view the same content at different URLs without being redirected.
Opinions differ on whether canonical tags should also be used when 301 redirects are already in place. One answer argues that, where redirecting is possible, a 301 redirect is the strongest signal asking Google to update its index, and a canonical tag is not important. Another recommends using both. These individual recommendations do not establish a rule that both must always be configured. For this question, the clearer conclusion remains: prioritize 301 redirects for permanent URL changes; consider canonical tags when the same content needs to remain accessible at multiple URLs.
301 redirects or canonical tags: perspectives from across the web
Can a 302 redirect replace a 301 redirect for a permanent URL change?
If the decision has been made to switch permanently to a new URL, these discussions favor using a 301 redirect. One answer suggests that Google may keep the old page indexed when a 302 redirect is used, so you cannot assume that using a 302 instead will produce the same result. However, the material is insufficient to determine how Google currently handles every 302 scenario, and it provides no timeline for index updates.
Do 301 redirects from old URLs have to be configured in .htaccess?
Not necessarily. A 2011 tutorial explains how to configure 301 redirects in .htaccess, but assumes the server uses Apache; another discussion offers an approach using PHP headers on the old page. Choose where to configure the redirect based on your actual server environment. These materials provide examples of implementation methods, not configuration rules that apply to every host.
References
- How to stop Google indexing both www. and no-www versions of my websitewebmasters.stackexchange.com — Discusses: Can a 302 redirect replace a 301 redirect for a permanent URL change?
- what's better for SEO : a 301 moved page vs an alias?webmasters.stackexchange.com — Source used in the article above.
- [SEO 技術分享] htaccess 301 Redirect 教學www.awoo.ai · 2011-08-02T07:21:02+00:00 — Discusses: Do 301 redirects from old URLs have to be configured in .htaccess?
- what's better for SEO : a 301 moved page vs an alias?webmasters.stackexchange.com — Source used in the article above.
- Move websites without losing search engine rankingswebmasters.stackexchange.com — Discusses: Do 301 redirects from old URLs have to be configured in .htaccess?
- SEO: 301 redirects and canonical tagwebmasters.stackexchange.com — Discusses: Can a 302 redirect replace a 301 redirect for a permanent URL change?
- Preventing Duplicates on Googlewebmasters.stackexchange.com — Source used in the article above.
- Consolidating multiple domain nameswebmasters.stackexchange.com — Source used in the article above.
- Preventing Duplicates on Googlewebmasters.stackexchange.com — Source used in the article above.

