Tag Info

Hot answers tagged

27

There are several reasons to remove extensions from URLs: To make the URLs look cleaner To make URLs easier to type To make URLs easier to remember To make URLs more SEO keyword friendly To be able to change technologies -- if you ever want to move your site from one technology to the other, its easiest to do so without users even knowing if there are no ...


7

One commonly used solution is to make your image URLs look something like this: http://www.example.com/path/to/images/1.jpg?v=123456 Here, /path/to/images/1.jpg is the actual URL path of the image, while ?v=123456 is just a dummy query staring tacked onto the end of the URL. The query string can be anything — a version number, a timestamp, a hash ...


6

All web servers have one or more "default files". It's the file that will be displayed whenever a visitor goes to a URL that ends in a slash /, i.e. a folder. If the default file name on your web server is index.php and a visitor goes to www.example.com/pagename/, they are actually accessing www.example.com/pagename/index.php. If there is no trailing /, ...


6

From our (Google's) point of view, you can use whatever file names & URL structure that makes sense for your site -- you definitely do not need to fine-tune it on this level for SEO purposes. For Image Search, we recommend using descriptive file names, but even if it's just a number (for example, when a photographer uploads files without modifying the ...


5

In order for IIS to allow access to the file at all, it needs to be assigned a MIME-type. Use application/octet-stream and the browser will almost certainly treat it as a file it can't handle itself. (You could also experiment with application/x-whatever-you-want)


5

Try not to think of it in terms of search engines. Instead consider it from a usability perspective. (Keep in mind search engines do take into account the bounce rate) The goal should be that the url should portray what the destination will be about. If there are multiple posters then you should go with posters.php Granted, the page title, description ...


5

Google is not going to care what you use for the suffix. Personally I would suggest you use .html simply because it says nothing about your underlying technology platform. Or, be deliberately deceptive and use something like .php on an ASP.NET site. From a security perspective this gives as little information as possible to anyone who might want to hack ...


4

However, isn't it kind of black-hat-like to use a suffix of .html? Web servers have been returning URI's ending in .html from the inception of HTTP - nothing wrong with using it today. Paranoia causes me to believe that Google may detect URL rewrite and potentially trigger the so-called over optimization penalty. Unless Googlebot has ...


4

The AddType directive lets you specify what MIME type(not entirely a complete list) a given file extension should be processed as. To make an arbitrary extension be processed as HTML: AddType text/html .whatever Note that there's generally very little reason to do this sort of thing, and it mostly just introduces maintenance work.


4

There are several ways to serve files without an extension. One of the easiest is to use the Multiviews option in your .htaccess. That option allows the /webpage.html document to be accessed through the /webpage URI. Then you can use a rewrite rule to make sure that the version with .html gets redirected to the version without the extension. Here is ...


4

That would depend on your webserver configuration. Many webservers do come configured that way. Here is a snippet from /etc/apache2/apache2.conf on my Ubuntu Linux webserver: # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <FilesMatch "^\.ht"> Require all denied </FilesMatch> Your ...


3

It is not a good idea from an SEO point of view to serve different content via Javascript since a web-crawler is likely to either see an empty page or always the default content. In either case, your content will not get fully indexed. Serving different content via PHP is doable and some entire sites are served by only a single file. Those sites usually ...


3

Just to clarify... 404 crawl errors are not necessarily a bad thing if the content genuinely does not exist. It is what 404's are for. You will not get penalised for having legitimate 404's. However, in this case it looks as if these are typos in the source URL, or people/search engines are linking to content that has moved. In this case you are potentially ...


3

This is the type of “cool” URI scheme that I aim for on my own personal website. Personally, the reason that I started to do so (and probably many more web designer/developers too!) was after reading the article “Cool URIs don't change” – this document was written by the World Wide Web's founding father, Tim Berners-Lee. In Tim Berners-Lee's famous ...


3

The key point to understand here is that a URL is an abstract concept. In fact, they should technically be referred to as a URI (Uniform Resource Indicator, rather than Uniform Resource Locator). In short, when a browser or user-agent makes a request to a URI, the server can return any content, with any headers. mysite.com/directory/specific-page/ is OK ...


3

We used to have rediculous URLs that read like: /DLLScripts/mydll.dll?APPLICATION=asdf&PROGRAM=asdf&ARGUMENTS=-N423,-A4 And our SEO was very, very poor because that URL tells me nothing about what's on that page (And I'm a human). A search engine knows even less than a human than what's on that page. So yes, it's important if you're running a ...


3

It has been verified that a PHP file can be used as a sitemap file such as sitemap.php I checked http://sitemaps.org (the website with the specification information for sitemaps) and there is no mention that the file must be saved in the .XML format. I will have to say that yes, it will work, as long as Google does not have a problem with the extension for ...


2

I would go with .html. The W3C actually recommends this practice in its CHIPs Note, and for two good reasons: To disguise the technology you are using today To keep your options open on the technology you will use in the future Even Tim Berners-Lee himself recommends not using technology-specific file extensions in his famous article “Cool URIs don't ...


2

This is how log rotation is handled on my Apache server. LogFormat "%h %l %u %t \"%r\" %>s %b" common CustomLog "|/usr/local/sbin/cronolog --american /usr/local/apache2/logs/access_log.%Y%m%d" common Cronolog creates a daily log file named something like access_log.20120213. I then have a cron job set to move old logs into a subdirectory, gzip logs ...


2

I completely agree to all the answers put above. Just adding that one of the reasons why extensions are hidden in URL is to security. Putting it simply, if you don't expose the extension in the URL, it is little hard to figure out the technology on which the application has been built. So lets say a page in made in PHP and the extension is not hidden, then a ...


2

If duplicating the image really is unnecessary then you could still perhaps have the best of both worlds... only store the image once, but have it referenced by different filenames, for the different languages - using mod_rewrite (Apache) and an internal rewrite. Based on unor's example: example.net/img/en/house.png example.net/img/es/casa.png These ...


2

I personally use a bit of both... I place all the images with a general purposes (things like : design, icons, site content, sprites, etc..) in a single directory. Then for everything related to a single "thing" on my website, by example a .jpg avatar related to a single user, I put that in a specific directory but inside of a centralized structure.. ...


2

Keep the filename including its file extension below 255 characters. Just to be safe. The actual lenght doesn't really matter. Personally I have never seen a penalty coming from a too long filename. Just don't keyword stuff it! Take into account that some characters have different encondings (such as ä, ö, ü, é, etc.) making your filename actually longer. A ...


2

No, a filename's location relative to the root does not affect SEO, and it certainly doesn't warrant adding 301 redirects to restructure your site for. As this article discusses, URLs should be easy for humans and search engines to understand. When a URL appears in a search engine snippet, if it's clear to search engine users what the link is to and how it ...


2

What we know about Google is that they use a system of indicators that tells the search engines what the content is about, there is a limit to how many indicators you can have and after that its ignored upto the point if over used it goes against you in negative SEO. So the path is one of many indicators removing SEF (Search Engine Friendly) urls will not ...


2

It's not standard, but it is common. Here are the terms of service URLs for some popular sites: www.google.com/accounts/TOS en.wikipedia.org/wiki/Terms_of_service https://twitter.com/tos https://www.facebook.com/legal/terms https://about.pinterest.com/en/terms-service en.wordpress.com/tos/ https://www.youtube.com/static?template=terms ...


1

Apache can be configured to follow symbolic links. I tested creating a symbolic link for the desired name to the old name. On the command line I did: ln -s My-Music.mp3 MyMusic.mp3 After which, Apache was happy to serve up the file at either http://localhost/My-Music.mp3 or http://localhost/MyMusic.mp3 To make it work you just have to have the correct ...


1

You can do this in PHP like so: <?php // We set the file type here header('Content-Type: audio/mpeg'); // un-comment this line if you want to enforce download and comment the line above // Content-Type "application/force-download" // It will be called MyAudio.mp3 header('Content-Disposition: attachment; filename="MyAudio.mp3"'); // The MP3 Source ...


1

If you are looking at images for SEO benefit, then forget about where to put them in your directory structure. Better look at creating an image sitemap and submit it to Google Webmaster for indexing.



Only top voted, non community-wiki answers of a minimum length are eligible