Hi all,

My programmer & I need to get rid of the .phtml pages another programmer had me create & make new .php pages.

He wants to:

"use the 404 SCRIPT (PHP file) that will do following.. based on REQUEST to non existing PHTML file it should get corresponding PHP file.. for example.. if requested was recommended_links.phtml then it'll get into recommended_links.php .. and so on.. for any PHTML file.. so SEs will think that PHTML files still exist"

Does anyone understand this & will I be penalized by the SEs?

Thanks & I hope everyone had a great Christmas :)


Michelle

Dani AI

Generated

Quick summary of the safe, SEO-friendly path for this change (context: wants requests for recommended_links.phtml to land on recommended_links.php).

Do not rely on a 404 handler that silently serves a PHP file. An ErrorDocument-driven script that returns content for a missing URL either returns a 404 (so search engines treat the page as gone) or, if it returns 200, looks like a “soft 404” or otherwise confuses indexing. That approach also fails to tell crawlers the page moved, so link value and rankings are not reliably transferred.

Prefer explicit server-side redirects (301 Permanent Redirects). A single-file example:

Redirect 301 /recommended_links.phtml /recommended_links.php

Or a pattern for many files with mod_rewrite:

RewriteEngine On
RewriteRule ^(.+)\.phtml$ /$1.php [R=301,L]

Those send a clear signal that the old URL moved to the new one and will preserve most search signals. After deploying redirects, verify with a header check:

curl -I http://yourdomain.com/recommended_links.phtml

Expect an HTTP 301 and a Location header pointing to the .php URL.

Other practical steps: update all internal links to point at the new .php URLs, regenerate and resubmit your sitemap, and watch crawl/indexing / link reports in your webmaster toolset. Avoid redirect chains and loops; keep redirects in place long-term (months to years) so incoming links continue to work. If you cannot redirect for some reason, use rel="canonical" on the duplicate pages to consolidate signals, but redirects are preferred when filenames truly change.

This combines ’s mention of server rewriting with ’s 301 recommendation, but with the added cautions and testing steps to prevent soft 404s, duplicate-content confusion, and lost link equity.

Recommended Answers

All 2 Replies

I can't answer your question whether or not you'll be penalized. I'd think not, but again, I have no certainty.

I'd like to offer another tip of advice: why not use .htaccess with mod_rewire? Have the server rename all the .php files 'on the fly.'

Its the same thing that's used on Daniweb to make the forums and threads more SE friendly. (I.e. thread23849.html)

More information at: http://httpd.apache.org/docs/mod/mod_rewrite.html

I don't recommend using mod_rewrite because this will create duplicate content, which google doesn't like. For example, the .php page and the .phtml page will both bring up the exact same content, and this could cause problems. Instead, I would use .htaccess to create 301 Permanent Redirects. These are used when content has moved locations (to a new filename, for example). It tells the search engines that upon reaching the old URL to redirect without penalty to the new URL.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.