...

View Full Version : Simple 301 Redirect confusion



cineweekly.com
12-17-2010, 11:52 PM
I'm getting conflicting tips on doing 301 redirects in .htaccess. Could someone please help me with these simple steps.

I want all my u-stu.com pages to redirect to http://www.cineweekly.com specifically and not their corresponding pages.

u-stu.com (with and without www)
goes to http://www.cineweekly.com

http://www.u-stu.com/images/pic.jpg
goes to http://www.cineweekly.com

http://cineweekly.com
goes to http://www.cineweekly.com


http://www.cineweekly.com/index.php
goes to http://www.cineweekly.com

cineweekly.com
12-18-2010, 06:33 AM
Nothing? I'd really appreciate anyone that could help.

Inigoesdr
12-18-2010, 09:14 PM
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.cineweekly\.com$ [NC]
RewriteRule ^(.*)$ http://www.cineweekly.com/ [R=301,L]

cineweekly.com
12-19-2010, 12:51 AM
Thank you so much, no one ever put the ! in there on ANY tutorial and it made all the difference.

cineweekly.com
12-24-2010, 05:18 AM
I just noticed a problem with the redirect. When I type in a subdirectory for cineweekly without using www. it takes me straight to the root.

I want:
cineweekly.com/images/pic1.jpg to go to http://www.cineweekly.com/images/pic1.jpg not the www root.

oesxyl
12-25-2010, 12:26 AM
Thank you so much, no one ever put the ! in there on ANY tutorial and it made all the difference.

try this one:

http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html

and follow links from the box from right side of the page.

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum