Question

Using htaccess, I want to brand my websites by adding a custom extension to all my pages, just for the looks.

Lets say that my company name is "xtreme web design" and I want to have all my pages end with .xwd instead of .php or .html, for example:

http://example.com/file.swd

If I specify MIME types, would this affect compatibility with browsers or devices? Would this have a negative impact on my SEO?

Was it helpful?

Solution

If this is purely for branding / the user to PERCEIVE - then you should be able to use a . so long as you escape it before hand. There will be no real effect on SEO, so long as your url is friendly and not filled with PHP get characters or such like.

Long answer shortened down - It's perfectly fine - just make sure you escape the characters when rewriting in your .htaccess

Hope this helps!

NOTE: This answer assumes you don't want to create a different file type - simply give the perception of a different file type.

To rewrite:

http://example.com/file.html

Do this in your .htaccess:

RewriteEngine On 
RewriteRule   ^file\.swd/?$   file.html  [NC]

The . escapes/nulls the period - it's important. Hope this solves your problem

OTHER TIPS

If you actually want the files on your server to have the custom extension, and not just be rewritten with Apache's RewriteRule, you can use the AddType configuration directive like:

AddType application/x-httpd-php .html .htm .xwd

I would bet there is a slight efficiency to be had by not using a RewriteRule, though it's undoubtedly small. ;-)

But either method shouldn't cause any problems for SEO, and while I can't speak for the search engines, I doubt this change alone would affect your rankings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top