Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Change in URL Structure

Featured Replies

Yo,

 

We have recently developed a site which has a different URL structure to the old one. For example /latest-news/article-name is now /news/2013/article-name.

 

We sort of anticipate our rankings dropping as a result. Is there any method around this? I'm guessing a 301 permanent redirect, but that's going to be tedious for the amount of pages I need to set it up for. Perhaps there's a .htaccess method or something similar?

 

Any ideas?

 

Thanks.

Hey Jack,

 

I recently did something similar. You can use Google Webmaster Tools if you need to figure out which URLs are currently active. Then, yes, use 301 redirects with .htaccess.

 

Here is an example of what I did:

 

RewriteEngine On

RewriteRule ^old_url.html$ http://foo.com/new_url.html [R=301,L]
RewriteRule ^contact/$ http://foo.com/contact.html [R=301,L]

 

You will need to specify full URLs for your rewrite rules.

Note the ^ and $. If you do not use them, and use old_url.html instead of ^old_url.html$, then the rule would also match anythingold_url.htmlanything.

 

~atomiku

  • Author

Welcome to WDF Atomiku.

You will need to specify full URLs for your rewrite rules.


This could become lenghy, there's over 100 articles that I need to move. I was hoping something like this existed:

RewriteRule ^/latest-news/$ /news/2013/ [R=301,L]

I might have to go with your option. Thanks for your help!

Jack, it's possible you could do something like /latest-news/ to /news/2013/... but I might need an example of your URLs.

 

/latest-news/news-post-title/

/latest-news/first-post-hello-world/

 

If you wanted to forward those to /news/2013/post-title/ instead, you could use the following rewrite rule:

 

RewriteEngine On
RewriteRule ^latest-news/(.*)(/|)$ http://foo.com/news/2013/$1/ [R=301,L,NC]

Now, the (/|) after the (.*) will optionally match a trailing slash at the end. http://foo.com/latest-news/post-title would now redirect to http://foo.com/news/2013/post-title/ --- This is assuming all your new post URLs are to have 2013 in them, and not 2012 or 2011!

 

If this won't work for you, there is the option of forwarding latest-news/(.*)/ to a PHP script, which would look up the post and then redirect to the correct URL via a 301 redirect. Below is a quick example:

 

RewriteEngine On
RewriteRule ^latest-news/(.*)(/|)$ http://foo.com/redirect.php?post=$1 [R=301,L,NC]

 

<?php

$post = mysql_real_escape_string($_GET['post']);
$query = mysql_query('SELECT * FROM posts WHERE post_title = "'.$post."'");

if (mysql_num_rows($query) == 0) {
  header("HTTP/1.0 404 Not Found");
} else {
  $row = mysql_fetch_assoc($query);

  header('HTTP/1.1 301 Moved Permanently');
  header('location: http://foo.com/news/' . $row['year'] . '/' . $row['url'] . '/');
}

?>

It sounds like the dynamic method of forwarding your URLs might work better for you.

~atomiku

Welcome to WDF Atomiku.


This could become lenghy, there's over 100 articles that I need to move. I was hoping something like this existed:

RewriteRule ^/latest-news/$ /news/2013/ [R=301,L]

I might have to go with your option. Thanks for your help!

I did a post on my blog that is
relevant to people interested in this discussion. Here’s a part of it…

 

 

 

Every year for at least 20
years now more money has been spent online in every business category than the
year before as people worldwide turn to the Internet for their wants, needs and
interests. Consider these eye-opening research facts:

 

 

 

61% of global Internet users
research products online. (source: Interconnected World: Shopping and Personal
Finance, 2012)

 

44% of online shoppers begin
by using a search engine. (Interconnected World: Shopping and Personal Finance,
2012)

 

60% of all organic clicks go
to the top three organic search results. (MarketingSherpa, February 2007)

 

75% of users never scroll
past the first page of search results. (MarketShareHitsLink.com, October 2010)

 

 

 

However, all this also means there’s
a swamp of competition in almost every niche or industry online. Worse, the SEO
rules seem to change every month, contradicting last month’s best practices. These
are the core reasons why almost all online businesses seek effective search
engine optimization for their websites, yet struggle to achieve meaningful
results.

 

 

 

If you learn how to achieve
it, consistently high rankings for the right keywords will steadily drive large
numbers of interested visitors to your website or those of your clients every
month. And if you play it right, you can also build a “herd”, as The
Millionaire Maker Dan Kennedy calls it, of loyal repeat customers from this
quality traffic.

 

 

 

An information overload of
SEO tools and courses have come out lately, all claiming to teach how to search
engine optimize for 2013 effectively – or even swearing to do it all for you
work-free. How can we identify a genuinely top quality SEO system out of the sea
of posers before us? Read the rest of this article to find out here: http://bit.ly/SEOsst1

I did a post on my blog that is
relevant to people interested in this discussion. Here’s a part of it…

 

 

 

Every year for at least 20
years now more money has been spent online in every business category than the
year before as people worldwide turn to the Internet for their wants, needs and
interests. Consider these eye-opening research facts:

 

 

 

61% of global Internet users
research products online. (source: Interconnected World: Shopping and Personal
Finance, 2012)

 

44% of online shoppers begin
by using a search engine. (Interconnected World: Shopping and Personal Finance,
2012)

 

60% of all organic clicks go
to the top three organic search results. (MarketingSherpa, February 2007)

 

75% of users never scroll
past the first page of search results. (MarketShareHitsLink.com, October 2010)

 

 

 

However, all this also means there’s
a swamp of competition in almost every niche or industry online. Worse, the SEO
rules seem to change every month, contradicting last month’s best practices. These
are the core reasons why almost all online businesses seek effective search
engine optimization for their websites, yet struggle to achieve meaningful
results.

 

 

 

If you learn how to achieve
it, consistently high rankings for the right keywords will steadily drive large
numbers of interested visitors to your website or those of your clients every
month. And if you play it right, you can also build a “herd”, as The
Millionaire Maker Dan Kennedy calls it, of loyal repeat customers from this
quality traffic.

 

 

 

An information overload of
SEO tools and courses have come out lately, all claiming to teach how to search
engine optimize for 2013 effectively – or even swearing to do it all for you
work-free. How can we identify a genuinely top quality SEO system out of the sea
of posers before us? Read the rest of this article to find out here: http://bit.ly/SEOsst1

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.