Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Use HTML site URL's Recreated exactly on Custom Wordpress Site? WordPress

  • SOLVED

We have created a new custom wordpress site and design for a client.

Clients current site is an html site on a custom CMS and we have been performing SEO on his site for about a year and have many ranking keywords to specific URL's to the html (current site)

We are now ready to transfer the domain to the new wordpress site and I was wondering the following:

1. Is there a way to utilize (create the same URL's on the wordpress site as the html site) the exact same URL's that we've performed SEO and link building to his html site and create them on the wordpress site WITHOUT doing 301 redirects? Meaning, we want to preserve all of the current page content and URL's from the HTML site onto the wordpress site.

2. Do this WITHOUT 301 redirects

Of course all NEW content and URL's on the new wordpress site will have their own structure and SEO done to them so that is a non issue. We just want to make sure we preserve all SEO benefits to new wordpress site.

I've searched all over for solutions or plugins that allow to create fully custom URL's.

For instance, a plugin that would allow me to change the slug on the URL from:

wordpress version: client.com/locations/los-angeles

To:

client.com/locations/los-angeles.html (on the wordpress site)

Hopefully that makes sense.

Tyler



Answers (4)

2011-12-02

John Cotton answers:

Tyler

I really think you should be using 301 redirects - Google isn't going to punish your SEO for that because that's what 301 redirects are for. It's almost certainly worse to have two pages with the same content (your new WordPress page and a view of that page via a rewrite)....

However, if you are dead set to do this, then this is how to do it:


1/ Add the following code to your header.php file, just before </head>:


<?php if ( is_singular() ) { ?>
<link rel="canonical" href="<?php the_permalink(); ?>" />
<?php } ?>


2/ Add the following code to your theme functions.php file


function my_add_rewrite_rules( $rules ) {
$newrules = array();

$newrules['^my-old-url-1$'] = 'index.php?p=212';
$newrules['^my-old-url-2$'] = 'index.php?p=315';
$newrules['^my-old-url-3$'] = 'index.php?p=72';
// etc for each of your 80 urls where p=id points to the page/post id of the replacement page

return $newrules + $rules;
}
add_action('rewrite_rules_array', 'my_add_rewrite_rules');


3/ Change your permalinks to whatever you want (/%category%/%postname% is good), but <strong>DON'T</strong> .html in there - it's extra bytes, unnecessary and doesn't add anything to your SEO. Save Permalinks (even if you don't change them).

Step 1 is important for telling Google (and others) which url is the REAL url - it should stop it penalising you for duplicate content.

Step 2 rewrites each of the urls (you've only got 80 and you only need to do it once). p=ID works regardless of how you set your permalinks and gives you the flexibility to change permalinks at a later point.

Step 3 executes the code in step 2.

JC

2011-12-02

Luis Abarca answers:

You can do that without plugins, just go to to Settings -> Permalink (/wp-admin/options-permalink.php) in your site and change your permalinks structure to something like this:

<strong>/%postname%.html</strong>

Check this example:
[[LINK href="http://e-acapulco.com/eventos/abierto-de-gimnasia-en-acapulco.html"]]http://e-acapulco.com/eventos/abierto-de-gimnasia-en-acapulco.html[[/LINK]]

is using this permalink structure
<strong>/%category%/%postname%.html</strong>


Tyler M comments:

I understand that, but what happens to the new wordpress pages we create? Everything will have to be in that structure right? OR can we control permalinks on a case by case basis?

Follow me?

There are about 80 URL's on the HTML site and we plan to build about 100 MORE pages on the wordpress site. We only need the custom URL's for the 80 URL's and then anything after that can just be standard wordpress with /%postname% permalink structure.

Is this possible?


Luis Abarca comments:

All the url have a similar URL: /location/page.html ??

You can create a custom post type to do that and edit the rewrite rules.

2011-12-02

stevenjgoldman answers:

I agree that /%category%/%postname%.html/ as a permalink adds .html but only to blog posts and not to pages. There is a free plugin available from wordpress (dot) org called .html on pages [[LINK href="http://wordpress.org/extend/plugins/html-on-pages/"]]Direct Link[[/LINK]]

Hope this helps..

2011-12-02

Julio Potier answers:

I agree too : /%category%/%postname%.html/ as a permalink adds .html but only to blog posts and not to pages !

Also, i know you don't want to use 301 but sometimes this is a good solution waiting google refresh the new links.