WordPress.org

Ready to get started?Download WordPress

Forums

Alternative to additional non-WP rewrites in .htaccess? (6 posts)

  1. anndonnelly
    Member
    Posted 3 years ago #

    When I am moving a site into WP, or any platform that will cause URL changes I'd normally put rewrites into the .htaccess so that users, and especially Google, can follow on to the new site:

    RewriteEngine On
    RewriteRule index.html$ http://e-business.ie [R=301,L]
    RewriteRule about.html$ http://e-business.ie/web-designers-ireland/ [R=301,L]
    etc...

    Just realizing that if I am enabling a network and am going to add a new site that also requires this there will be issues if there were common urls.

    Can anyone foresee any other issues I might have with this?
    Is there a plugin that will handle these redirects?

  2. I do the same thing, and so long as you put the redirects ABOVE the calls for WordPress, generally it goes smoothly. I don't suggest a plugin, since .htaccess is powerful enough to handle it on it's own (and will come with you if you move off WP AND doesn't generally need to be upgraded ;) )

  3. anndonnelly
    Member
    Posted 3 years ago #

    Thanks, Ipstenu -- what about when it's a network and you need to rewrite for more than one site and they had the same file name?

    Can you put the full url in the rewrite? I think I've tried that before and it didn't work, but I can try it out. Something like:

    RewriteEngine On
    RewriteRule http://site1.com/contactus.html$ http://site1.com/contact-us/ [R=301,L]
    RewriteRule http://site2.com/contacust.html$ http://site2.com/contact-us/ [R=301,L]

    (site2.com will actually be 2.site1.com with domain mapping, if that makes a difference)

  4. Not to throw a wrench in the works, but you can set permalinks with .html at the end to eliminate the need for redirects. (in many cases, anyway)

  5. anndonnelly
    Member
    Posted 3 years ago #

    Oh, I didn't think of that, Andrea! Thanks. Can I do a permalink with the 'slug'.html? Postname wouldn't work in this case. I can fiddle with the slugs. Or can it only be as noted here: http://codex.wordpress.org/Using_Permalinks ?

  6. Postname == slug :) So yes, yes you can ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.