WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] pages broken after htaccess 301 change (3 posts)

  1. themightyant
    Member
    Posted 4 years ago #

    Hi,
    I have just moved a website from a subdirectory to the root of the domain for launch by moving and updating the index.php file.

    This worked fine until I added an htaccess file to the root to redirect old html pages to the top-level URL (I have restored the old index.htm for the time being)

    The home page came up fine but any second level links eg: http://example.com/our-collection now display a 'Not Found - The requested URL /for-every-occasion was not found on this server.' message.

    I removed the htaccess file as soon as I noticed the problem but the problem persists

    The htaccess file contained the following

    redirect 301 /bespoke.htm http://example.com
    redirect 301 /collections.htm http://example.com
    redirect 301 /contact.htm http://jexample.com
    etc.

    I can rename the index.htm file to prioritise wordpress if necessary for you to recreate the problem.

    I usually like to figure it out myself and find answers on this forum but this is the first time I have not found a similar case.

    Any help would be greatly appreciated.

  2. themightyant
    Member
    Posted 4 years ago #

    Hi I have fixed this.
    If anyone else has a similar problem it is because WordPress already writes to an htaccess file to make pretty permalinks. As such writing my own htaccess file overrided the wordpress permalinks.

    To fix, in the wordpress backed just go to Options -> Permalinks and update the permalink structure, it should rewrite the htaccess file.

  3. esmi
    Forum Moderator
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.