ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Redirects from HTML to new EE/PHP site

November 02, 2010 5:43pm

Subscribe [2]
  • #1 / Nov 02, 2010 5:43pm

    erfi75

    34 posts

    Hi everyone,

    I was excited to redevelop my old, handmade HTML site using EE. After relaunching the site (by and large a huge upgrade), I noticed that my site has disappeared from search engines. This is because all of my HTML pages, of the type example.org/country2.html, are now returning 404 Not Found errors.

    I found support in the EE wiki to make my old index.html redirect to index.php using .htaccess, but after several frustrating weekends spent searching here and the broader web, I’ve not been able to find the code to make a redirect rule that says example.org/ANY_PHRASE.html—> example.org/index.php. (By ANY_PHRASE I mean things like faq.html, col2.html, contact.html, etc—I want all old URLs to direct to the new homepage).

    Can anyone help me write this rule?

    Thanks in advance—I realize it is probably basic but I am lost on this one.
    Eric

  • #2 / Nov 05, 2010 8:01pm

    McCoy IT

    41 posts

    RedirectMatch "\.html$" <a href="http://www.example.com/index.php">http://www.example.com/index.php</a>

    This will redirect all requests to files that end with .html to the index.php file.

  • #3 / Nov 07, 2010 7:18pm

    erfi75

    34 posts

    Thanks very much, McCoy IT. That did the trick, where all my previous attempts just caused errors.

    I really appreciate it!

    Eric

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases