1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Mar 2008
    Rep Power

    How to rewrite/redirect a folder name with .htaccess

    I have a folder in my site that I want to rename. I donít want to just rewrite the URL and keep my old folder name, I want to change the folder name and then do whatever is necessary with .hataccess to not lose search engine rankings. The folder name I want to change has a space in it and also is misspelled (whoops x2)


    Mysite.com/old foldr/page.html


    How would I go about doing this with .htaccess? Do I just switch the folder name on my server and then set up a redirect, or do I do a rewrite? Sorry now familiar with the terms or .htacces.

    Thanks all
  2. #2
  3. No Profile Picture
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Dec 2013
    Rep Power
    How about creating a new folder?
    Clearly, you would want to redirect all your material from the old folder to the new folder; to redirect all files in the folder to the new folder/ directory in .htaccess, try this:

    RewriteEngine On
    RewriteRule ^old\ foldr/(.*) /newfolder/$1 [R=301,NC,L]

    This should also account for the space in the name and you can move all your files.
    The redirecting of your files is only to avoid your user having to see an "error" page.

Similar Threads

  1. .htaccess Changing Folder On Your Site .... ?
    By jamessorenson in forum SEO Help (General Chat)
    Replies: 6
    Last Post: Feb 2nd, 2011, 01:18 PM
  2. Can someone make sense of my attempt at an .htaccess mod rewrite script (301 redirect
    By Snakeaconda in forum Web Design, Coding and Programming
    Replies: 0
    Last Post: Nov 4th, 2009, 05:55 PM
  3. Use url rewrite to change domain based on folder...
    By tnelson in forum Search Engine Optimization
    Replies: 0
    Last Post: Sep 25th, 2009, 08:29 PM
  4. .htaccess rewrite VS 301 redirect
    By rlopes in forum Web Design, Coding and Programming
    Replies: 5
    Last Post: Sep 13th, 2009, 11:17 AM
  5. Htaccess with rewrite and redirect to rewrite
    By Wampy in forum SEO Help (General Chat)
    Replies: 0
    Last Post: Apr 24th, 2006, 05:44 PM

IMN logo majestic logo threadwatch logo seochat tools logo