PDA

View Full Version : Changing URL Structure



Mike
04-06-2007, 12:52 PM
Hi all,

On one of my sites, my articles are located in the root. It's getting bigger though, so really I'd like to put them in a seperate folder. However, they all are getting reasonable search engine traffic, so could anyone say what would be the best way to change them?

Kyle
04-06-2007, 01:49 PM
Setup 301's for each page to the new location. It is a pain in the ***, but the only real solution.

Leave the old pages with the 301's up for a year or so, then take the old pages down.

Also, there is php or asp code available to apply a 301 right on the page. Nothing is needed to be done in the server config.

Chris
04-06-2007, 01:50 PM
Well, you could do rewriting or a SEF setup that keeps them with the same URL but moves them elsewhere.

The simplest URL rewrite setup would be to take all requests for /article/* and instead look for /*

Mike
04-06-2007, 02:31 PM
But a 301 would work? Does that mean that all links to site.com/article.php will count towards site.com/directory/article.php? Will it guarantee that rankings won't be affected?

Thanks...

Chris
04-06-2007, 04:23 PM
301's aren't 100%. Just do a rewrite.

RewriteEngine On
RewriteRule ^(.*).php /directory/$1.php

of course that'd mean you'd have to move your index.php file to /directory/ as well... unless all articles had a common naming convention.

rpanella
04-06-2007, 05:29 PM
Chris' suggestion would change your directory structure but not your URL structure (articles would now be located in a different folder but still accessed as before). Is this what you are trying to accomplish, or are you trying to actually change your URL structure as the title suggests?

If you plan on changing the URLs, a 301 redirect is the best way since it should preserve incoming links etc, but nothing is guaranteed and rankings may certainly drop. I would not recommend doing this unless you have to for some reason.
________
Mflb (http://vaporizer.org/portable)

Mike
04-07-2007, 12:40 AM
301's aren't 100%. Just do a rewrite.

RewriteEngine On
RewriteRule ^(.*).php /directory/$1.php

of course that'd mean you'd have to move your index.php file to /directory/ as well... unless all articles had a common naming convention.

I'm not that familiar with regular expressions, but isn't there something which says look for a string that doesn't have certain characters? Could you manipulate it to ignore it if it's index.php?

Chris
04-07-2007, 05:15 AM
You could probably make it ignore any file that begins with the letter I... probably the whole word but that'd be a long expression.

Mike
04-07-2007, 09:35 AM
Ah right, and this method should mean that rankings aren't affected?

Dan Morgan
04-07-2007, 02:36 PM
Correct.

I am facing a similar dilemma with a well established 4 year old site. I want to switch from using the CMS yet I am stuck with 1,500 existing links all (rewritten) based on the particular structure from the CMS. They all share a single unique numeric identifier which I could build into the new system but it will be a pain.

Mike
04-07-2007, 02:50 PM
Are you still going to move to a rewrite then Dan?

Dan Morgan
04-10-2007, 04:47 AM
Are you still going to move to a rewrite then Dan?

Yep, in a way.

As Chris says 301's are not 100% effective and will be a time intensive process. I value the existing external (deep) links so would not want to eventually remove those 301's as those sites linking will not adhere to 301's in any shape or form.

My plan, is to mirror the existing URL structure within the new CMS so all existing links work, and for new pages remove an unrequired alphanumeric elements and replace it with an alphanumeric representation of the page title.

Currently:

http://www.domain.com/content/view/20/498

Only the final integer, 498 is used in identifying the article row (and will be in the new custom CMS), and 20 represents the category.

Moving forward existing links will work as:

http://www.domain.com/content/view/20/498

But new ones will be structured:

http://www.domain.com/a/articlename/20/500/

or

http://www.domain.com/20/500/a/articlename/

"articlename" may be discarded when rewriting and the page pulled will be based on a combination of '20', '500' & 'a', depending on the scale and the complexity of the new CMS. I am currently weighing up the pros and cons of a translation table to enable just articlename for new urls and no surplus numbers.