I was wondering if you would get penalized for makeing your file extension a major keyword and then added the extensionsn to be run through as php? like http://"whatever"/index."keyword" or even have the index page a rediredt or write an htaccess for the index file.

Dani AI

Generated

Short answer for : the bolding you saw is just the search engine highlighting query text found inside the snippet (title, meta/snippet text or the visible URL). That UI behavior does not mean the extension helps your ranking. and were essentially correct, and 's caution about downside is worth taking seriously.

Why it looks that way: search engines match the literal query terms to the visible parts of a result. If someone searches for "php" and your URL contains file.php, the engine may emphasize that substring in the result. That is a display feature, not an indicator that file extensions carry topical weight for ranking. For guidance on readable URLs and linkable structure, see Google’s SEO starter guide (best practice: make URLs human-readable and meaningful) and Moz on URL structure.

Why you should avoid inventing keyword extensions: it creates duplicate/fragmented URLs (different URLs for the same content), adds redirect and maintenance complexity, can break assumptions in link building and analytics, and provides no real SEO benefit. If you do implement server rewriting to mask extensions, always pick one canonical URL and use 301s or rel=canonical to consolidate signals.

If a rewrite is needed for compatibility or branding, do an internal rewrite (not a permanent public duplicate) and canonicalize. Example rewrite patterns (illustrative):

# Apache: map requests ending in .keyword to .php internally
RewriteEngine On
RewriteRule ^(.*)\.keyword$ $1.php [L,QSA]
# Nginx: try mapping .keyword to .php
location ~ \.keyword$ {
    try_files $uri $uri.php =404;
}

Better approach: use descriptive path segments and put keywords in title tags, headings, content and structured data. That gives real SEO value with far fewer technical risks. For further reading, start with Google’s SEO starter guide (https://developers.google.com/search/docs/fundamentals/seo-starter-guide) and Moz’s URL guide (https://moz.com/learn/seo/url).

Recommended Answers

All 5 Replies

I don't think there would be a benefit. If file extensions played any role in ranking, every site in the world would rank for the keywords 'html', 'php', etc.

I think that might be like looking for trouble since I agree. If you don't see much or any upside, there is only downside.

well that is a very zen way of looking at it , but seriously don't try it you might like it

That's right, extension never pay any role in ranking

I now know they do not play a role in ranking but what about searches, there has been many a time I would search for php and something else and I would get search results with the php file extension in bold as if it would use the extension as a search keyword. That is basically why I asked this question. My last comment I had to much juicy juice.

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.