Website not redirecting with .htaccess file

I’m a newbie at webdevelopment and I’m trying to redirect my website from http://www.webpage.com to http://www.webpage.com/wp/ but I can’t seem to get my .htaccess file to work correctly. I’ve been trying to figure this out for several days without any luck and am starting to get frustrated. Can anyone see what I’m doing wrong?

# DO NOT REMOVE THIS LINE AND THE LINES BELOW REDIRECTID:nIwYzr 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^webpage.com$ [OR] 
RewriteCond %{HTTP_HOST} ^www.webpage.com$ 
RewriteRule ^$ http://www.webpage.com/wp [R=301,L] 
# DO NOT REMOVE THIS LINE AND THE LINES ABOVE nIwYzr:REDIRECTID

# Do not remove this line, otherwise mod_rewrite rules will stop working 
RewriteBase /

Related posts

1 comment

  1. If you are only trying to move the default page across, you can use:

    Redirect /mainpage http://webpage.com/wp/
    

    where mainpage is the default page your website opens to, often something like index.html is the main page for your website. You can try this to see if your htaccess is being read at all by trying this and seeing if you can redirect individual pages.

    Otherwise, your version looks like it should be correct.

    As was commented above, make sure that your access file is being read. Make sure you have it in the lowest level of your domain, at /.htaccess and make sure your server is configures to use it.

    If you are using apache, have you added:
    Options +FollowSymLinks before this somewhere? I believe apache requires this directive if you are using rewrite, but only apache.

    Making your file:

    # DO NOT REMOVE THIS LINE AND THE LINES BELOW REDIRECTID:nIwYzr 
    Options +FollowSymLinks
    RewriteEngine on 
    RewriteCond %{HTTP_HOST} ^webpage.com$ [OR] 
    RewriteCond %{HTTP_HOST} ^www.webpage.com$ 
    RewriteRule ^$ http://www.webpage.com/wp [R=301,L] 
    # DO NOT REMOVE THIS LINE AND THE LINES ABOVE nIwYzr:REDIRECTID
    
    # Do not remove this line, otherwise mod_rewrite rules will stop working 
    

Comments are closed.