Support » How-To and Troubleshooting » redirect folder to homepage

redirect folder to homepage

  • Hello

    Maybe a simple thing to do in .htaccess but haven’t been able to figure it out

    I would like to redirect any url with http://www.mysite.com/photos/… to just http://www.mysite.com/
    That is, anything in the photos folder & and its sub-folders & content gets redirected to the homepage

    How would I do this with .htaccess or is there an easier method?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Try RedirectMatch 301 /photos/(.*)$ http://mysite.com/


    thanks for the reply. Unfortunately it didn’t work.

    This is how I added it in the .htaccess file:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /wp213/

    RedirectMatch /photos/(.*)$ http://localhost/wp213/

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp213/index.php [L]

    # END WordPress




    localhost wont work.

    localhost is different for everyone — its THEIR machine.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘redirect folder to homepage’ is closed to new replies.