1

I'm working on a massive site overhaul and the main structural change will be a move from static HTML to PHP. I work for an art gallery, and having the artist names in URLs is critical. We already have substantial link authority for a variety of artist names, and the URL structure has been domain.com/artist-last-name/artist-full-name.html (eg. domain.com/picasso/pablo-picasso.html).

I'm considering multiple approaches and was hoping to get some advice on what might be the best one. My first consideration was using an htaccess directive to process PHP files as HTML, so that I could keep the exact same URL structure (or at least the appearance of which); but I'm not sure if there are any drawbacks to this approach other than the additional server load. I'm also considering keeping the PHP extension and just converting everything with the assumption/hope that search rankings won't be affected, eg. domain.com/picasso/pablo-picasso.php.

I suppose I could also change the link structure entirely, and change the directory names to the full artist names with an index.php in each, eg. domain.com/pablo-picasso/ which would be cleaner, but perhaps disturb the existing rankings.

If anybody has any advice regarding the above approaches, or something entirely different, I'd be most appreciative.

1

Use 301 redirects and drop the file extensions.

I can point you to some authoritative articles that will help you make your decision on how to approach redirects, URIs and SEO in general.

1) 301 redirects is considered the 'best-practice.' You can read the MOZ (widely considered and authority on SEO) article for more details.

2) As for best-practices on URLs (URIs), there is no reason to broadcast your file extensions - and what if you change, for example, from .php to another technology?

Ask yourself what value to the site visitors do file extensions in your URI's have? (Unless, of course they might have bad intentions - e.g. they like to exploit vulnerabilities in PHP, and that doesn't benefit your site at all!) - so drop the file extensions unless you can come up with a good reason to keep them.

3) Best-practices for the long-term

It is the the duty of a Webmaster to allocate URIs which you will be able to stand by in 2 years, in 20 years, in 200 years. This needs thought, and organization, and commitment.

The W3C's guidelines and recommendations will help you out a lot in setting up your site URIs using best-practices.


As for the impact on search engines, you rankings might stay the same, they might improve or they might drop.

This has much less to do with using 301 redirects than the fact that search engine algorithms change frequently.

For example, Google changes it's algorithms 500-600 times a year (about twice a day) - and the changes in the algorithms usually impact rankings, some times a little bit, and sometimes you will see a major change.

I always tell my clients that 'we follow industry best-practices and ethical SEO,' and IMO, this is always the way to go.

You can read the pros and cons of Black-Hat vs. White-Hat SEO for more details - although it's beyond the scope of your question, I think the frequent algorithm changes and the possible negative consequence of Black-Hat SEO make a strong argument to follow the recommended best-practices across the board - use 301 redirects and follow the W3C guidelines for URI's.

The following article, "Recovering from an Algorithmic Penalty Using 301 Redirects: A Personal Experience," reviews 2 case studies on 301 redirects and will help guide you through the process.

For your particular case, here is what I would recommend

  1. Be consistent (i.e. if you use http://mywebsite.com/artist then stick to that format) - that's an example purpose only, I'll recommend a specific format (root-relative URL).

  2. Even internal links that link to a file with the extension are problematic - for the same reasons. Link to '/directory-name' (/artist-name) with no trailing slash (it's not needed and you can configure your server to just treat this as a directory). I recommend using a root-relative URL for internal links (i.e. leave out the 'http://www.mywebsite.com' and use a forward slash such as '/artist-name') - this is based on the assumption that the directory or file is permanent in the file structure.

  3. Keep your directory structure flat - "www.mywebsite.com/this-specific-artist" as opposed to "www.mywebsite.com/art/our-artists/this-specific-artist" - the shorter URL is, the easier it is for people to remember and type.

  4. Take your time. Research and plan. There are a lot of great recommendations from trusted authorities in the links provided. Plan and think it through. Evaluate a) what are the shortest URLs; b) which URLs are most 'human readable'; c) what structure provides the greatest 'permanency'; and d) what directory and file naming conventions keep your options open to use a controller or any server-side programming language of your choice in the future (i.e. linking to file with a specific extension means you'll have to have either stick to that server-side language or do weird server configurations - so keep your options open and drop the file extensions).

  • 1
    thanks so much for your thorough answer, NivF007. I will check out the articles you've referenced, and that sounds like a reasonable approach. Just so I understand, wouldn't I need to set up specific redirects, in my case, for each artist page from html to php, i.e. "artist-name.html" to "artist-name.php"? And you're advocating dropping the extension entirely, in which case I guess it would make sense for me to structure the site simply as "domain.com/artist-full-name," in which case I would have an index.php within each folder labeled with the artist's full name? Thanks for the clarification. – nickpish Apr 17 '14 at 7:07
  • It depends on your site architecture (i.e. it appears you are not using a controller or dynamically generating pages) so the simplest way would be to 301 redirect (htaccess) your existing pages from '/artist-name.php' to '/artist-name/' and have the server default to 'index.php' within that folder (some also use a blank index.html to prevent directory traversal). You want to always direct the site visitor to the artist directory - the permanent URI. Make sure new pages at the redirected URI are ready before you redirect because you will be penalized for redirecting to a 404 or 'stubs.' – NivF007 Apr 17 '14 at 7:27
  • Ok that makes sense, thanks again. Also, you are correct in that I am not currently using a controller or dynamically generating the pages, although that may come later in the form of a CMS. I do like the idea of the cleaner link structure. – nickpish Apr 17 '14 at 7:48
  • NivF007-- I've decided to go with your route, and I plan to look at the resources you've referenced. A quick immediate question I have though, is given that I will be shifting to a format of "artists/artist-name/index.php" and hiding the extensions, should I also link within the site to extension-less URI's, eg. if I have a page "exhibitions.php" that will render as "/exhibitions/" should I link within the site to the latter, extension-less iteration or the former, physical page? I ask this question in the interest of SEO optimization. Thanks for any feedback. – nickpish Apr 18 '14 at 7:51
  • 1
    thanks for all the helpful info Niv, it's greatly appreciated. I have just accepted your response as an answer, but I unfortunately don't have enough rep points (apprently) on this specific SE forum to upvote it... – nickpish Apr 18 '14 at 8:37
0

I think that it all depends upon the inbound links to your site. I assume that they contain the .html and so I am working from this.

If that is the case, then why upset the apple cart?

I like your own suggestion: My first consideration was using an htaccess directive to process PHP files as HTML This seems like a good solution. I say this because link authority and SEO are important enough that you will want to preserve it assuming that it is strong enough that it cannot be replaced easily.

One other option is to 301 redirect each important link and just create your site the way that makes the best sense for your company. 301 redirects are said to cost about %10-15 in link juice where the other option you suggested will not.

It is the flip of the coin really. I like your first suggestion. But if the inclination to restructure the site is strong, then consider the 301 redirect option. Think of your future needs to. But do not throw away link juice.

  • Thanks much for the response, that makes sense. Interesting, as I did not realize that 301 redirects are said to cost in link juice. Seems option 1 might be the best way to go; especially as we do have a fair amount of inbound links. I'm currently trying to figure out the syntax for parsing HTML as PHP on my hosting provider's server and it's proving extremely difficult; do you have much experience with this? It's XO Communications, as I believe they run PHP as CGI... – nickpish Apr 17 '14 at 2:40
  • The %10-15 is an estimate that some claim (like MOZ if I recall correctly). I just wanted to warn you that there may be a cost, however small. It has been a while since I changed Apache to use .html as .cgi. I think you have to disable the .html where it is defined and then add it where the .php is defined in the CGI. I used to do this before PHP became popular... and that was a while ago! – closetnoc Apr 17 '14 at 3:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.