htaccess help plz
- Started
- Last post
- 9 Responses
- trooperbill
hi guys,
i need to move a site to a folder on another domain and want to automatically 301 direct all urls from the old domain to paths within a folder on the new one i.e.
foo.com/post/
to
foo.com/blog/post/(its wordpress)
anyone know what i need in the .htaccess file to do this?
- neverblink0
Your post leads me to believe you want:
foo.com/post/
to
bar.com/blog/post/correct?
- trooperbill0
yeah
like
foo.com/anything
bar.com/blog/anything
- ********0
I used to know, something along the lines of:
301 foo.com/post/ bar.com/blog/post/
in that order specifically, I think...?
- ********0
I was almost right.
-----------------------
redirect 301 /old/old.htm http://www.you.com/new.htm
-----------------------
- trooperbill0
Ive found this...
so do i just change the path of the second bit to the new url?
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$
http://www.domain.com/$1 [L,R=301]
- trooperbill0
ok then how do i make it use a wildcard?
foo.com/*
moo.com/blog/*
??
- ********0
I can't remember or don't know... haha
- rounce0
Try this, I didn't test it mind so be warned...
http://pastie.org/821982
- ********0
rm -r *