The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Problem with .htaccess 301 redirect for Wordpress site in a subdirectory

kingworkskingworks Registered User regular
edited August 2012 in Help / Advice Forum
Moving an .html site into Wordpress, but the redirects are not working.

Ex: http://www.schoolpsychologistfiles.com/EmDisability.html should go to http://www.schoolpsychologistfiles.com/EmDisability

Instead, users get a 404 error.

Wordpress files (including the .htaccess file I edited) reside here:
/public_html/schoolpsychologistfiles

Here is the .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
RewriteEngine On
rewriterule ^ADHD.html(.*)$ http://www.schoolpsychologistfiles.com/adhd/$1 [r=301,nc,l]
rewriterule ^ADHDfaq.html(.*)$ http://www.schoolpsychologistfiles.com/adhdfaq/$1 [r=301,nc,l]
rewriterule ^asfaq.html(.*)$ http://www.schoolpsychologistfiles.com/asfaq/$1 [r=301,nc,l]
rewriterule ^aspergers.html(.*)$ http://www.schoolpsychologistfiles.com/aspergers/$1 [r=301,nc,l]
rewriterule ^autism.html(.*)$ http://www.schoolpsychologistfiles.com/autism/$1 [r=301,nc,l]
rewriterule ^behavioralPlans.html(.*)$ http://www.schoolpsychologistfiles.com/behavioralplans/$1 [r=301,nc,l]
rewriterule ^consultation.html(.*)$ http://www.schoolpsychologistfiles.com/consultation/$1 [r=301,nc,l]
rewriterule ^EligibilityFaq.html(.*)$ http://www.schoolpsychologistfiles.com/eligibilityfaq/$1 [r=301,nc,l]
rewriterule ^EmDisability.html(.*)$ http://www.schoolpsychologistfiles.com/emdisability/$1 [r=301,nc,l]
rewriterule ^Ineligibility.html(.*)$ http://www.schoolpsychologistfiles.com/ineligibility/$1 [r=301,nc,l]
rewriterule ^Ineligible.html(.*)$ http://www.schoolpsychologistfiles.com/ineligible/$1 [r=301,nc,l]
rewriterule ^LearningDis.html(.*)$ http://www.schoolpsychologistfiles.com/learningdis/$1 [r=301,nc,l]
rewriterule ^slowLearnerFaq.html(.*)$ http://www.schoolpsychologistfiles.com/slowlearnerfaq/$1 [r=301,nc,l]
rewriterule ^specialEducation.html(.*)$ http://www.schoolpsychologistfiles.com/specialEducation/$1 [r=301,nc,l]
rewriterule ^spedTesting.html(.*)$ http://www.schoolpsychologistfiles.com/spedtesting/$1 [r=301,nc,l]
rewriterule ^testScores.html(.*)$ http://www.schoolpsychologistfiles.com/testscores/$1 [r=301,nc,l]

Any help or advice is greatly appreciated.

kingworks on

Posts

  • Liquid HellzLiquid Hellz Registered User regular
    rewriteengine on
    
    
    RewriteCond %{HTTP_HOST} ^fairwindinspections.com
    RewriteRule (.*) http://www.fairwindinspections.com/$1 [R=301,L]
    
    
    Options +FollowSymLinks
    RewriteCond %{THE_REQUEST} ^.*/index\.htm
    RewriteRule ^(.*)index.htm$ http://www.fairwindinspections.com/$1 [R=301,L]
    
    
    Options +FollowSymLinks
    RewriteCond %{THE_REQUEST} ^.*/index\.html
    RewriteRule ^(.*)index.html$ http://www.fairwindinspections.com/$1 [R=301,L]
    

    Try separating them out like this? Its how I did mine and they work fine. Also sometimes it takes a little while to update after you change the htaccess file, and of course you need to clear your cache when going back to the site. Also I believe there was something I had to do in WordPress to get it to work (maybe with the database?) but I really cant remember it was so long ago. There is also a plugin for this people seem to like wordpress.org/extend/plugins/redirection/

    What I do for a living:
    Home Inspection and Wind Mitigation
    http://www.FairWindInspections.com/
  • kingworkskingworks Registered User regular
    I tried that plug-in. From what I can tell so far, it's exactly what I needed.

    Many thanks!

Sign In or Register to comment.