Htaccess Question

contentfreak

Registered Member
Joined
Jun 13, 2010
Messages
87
Reaction score
23
hey guys

I have a question

I want to make via htaccess redirect 301 so that anyone who goes to site.com/blog/* lands on site.com/new-blog/

Redirect 301 /blog/ http://www.site.com/new-blog/ worx alright but keeps the extension

if they go to /blog/1.html then it will send them to /new-blog/1.html which is obviously a 404

so how do i make them all land in the front page?

Thnx!!!!!
 
hey guys

I have a question

I want to make via htaccess redirect 301 so that anyone who goes to site.com/blog/* lands on site.com/new-blog/

Redirect 301 /blog/ http://www.site.com/new-blog/ worx alright but keeps the extension

if they go to /blog/1.html then it will send them to /new-blog/1.html which is obviously a 404

so how do i make them all land in the front page?

Thnx!!!!!


depending on who your host is, you can probably do it from the cpanel, quite easily actually. look for the domain redirection.
as far as htaccess goes. im not to savvy in that field.
 
thnx for that man, i didn't know that was possible thru hosting, can u explain how to do that from hostgator's cpanel?

also if anyone else knows how to do it through htaccess, i prefer htaccess solution

thnx
 
thnx for that man, i didn't know that was possible thru hosting, can u explain how to do that from hostgator's cpanel?

also if anyone else knows how to do it through htaccess, i prefer htaccess solution

thnx


lol yeah, go into the cpanel, go down to the domains bar, and look for "redirects"
click it... you know you want to.

and 301 it . that was easy
 
ok, tested it and it does the same like i did with the htaccess in the beginning
still if someone goes to old-blog/1 it will redicret to new-blog/1 which is 404
 
add another htaccess in the new folder
ErrorDocument 404 /404.htm (modify to your page)

or use "mod rewrite" google it
 
Yes, use Mod Rewrite.

Try this

Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^blog/* /new-blog/index.html

Edit: your original regex should work within Rewrite
 
Last edited:
it still dont go to main page but to 404
 
Gimme a sec

Look back at my original post.
 
Last edited:
worx!!!

RewriteRule ^blog/* /new-blog

needed to loose the extension, mistake on my hand

thnx alot
 
Last edited:
Back
Top