help please - 301 redirect not working

For the last 2 years I have had a .htaccess file redirecting traffic from www.scottyh.com to www.scottyh.net as follows:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?scottyh\.com
RewriteRule ^.* http://www.scottyh.net/index.htm [R=301,L]

Earlier today it passed the test here......

http://www.webconfs.com/redirect-check.php

...and still does.

Now I want scottyh.net to redirect all traffic to the home page of www.lighttouchimages.co.uk. So I cribbed from the above and set up the following:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?scottyh\.net
RewriteRule ^.* http://www.lighttouchimages.co.uk/index.htm [R=301,L]

But this does not work and does not pass the test at http://www.webconfs.com/redirect-check.php

Any help appreciated!

Thanks

Scott
scottyh56Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ShaneJonesCommented:
Try this instead

if scotty.net index page is index.php

Redirect 301 /index.php "http://www.lighttouchimages.co.uk/"

otherwise change the php for html htm asp cfm or whatever
0
RoshaoarCommented:
As per the message on the site, what does your error log say? :)

One mistake I sometimes make is forgetting to use the correct permissions on the .htaccess - it should be set at 755
0
scottyh56Author Commented:
I've now tried;
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?scottyh\.net
Redirect 301 /index.htm "http://www.lighttouchimages.co.uk/"
and
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?scottyh.net
Redirect 301 /index.htm "http://www.lighttouchimages.co.uk/"

I've also set permissions to 755...

Sorry, no luck.
0
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

ShaneJonesCommented:
just use this 1 line after RewriteEngine on

Redirect 301 /index.php "http://www.lighttouchimages.co.uk/"

ignore all of the
RewriteCond %{HTTP_HOST} ^(www\.)?scottyh\.net
part as this is not needed
0
ShaneJonesCommented:
sorry meant to change it to htm

Redirect 301 /index.htm "http://www.lighttouchimages.co.uk/"

0
RoshaoarCommented:
hmmm, so I still get http://www.scottyh.com redirecting to http://www.scottyh.net/index.htm and the error is on http://www.scottyh.net/index.htm. Which might indicate to me that the .com bit hasn't actually been changed. Are you sure you're changing the right one?

Try completely deleting the .htaccess file on http://www.scottyh.com, then doing it afresh

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?scottyh\.com
RewriteRule ^.* http://www.lighttouchimages.co.uk/" [R=301,L]


0
scottyh56Author Commented:
Hi
Same problem is seen. I've also tried the simple
Redirect 301 / http://www.lighttouchimages.co.uk
No luck.....

0
RoshaoarCommented:
The problem you're seeing isn't on .com. it's on .net. If there were a problem on .com the address would show the error when you're on .com. The error is on .net - and I think you're putting the .htaccess you mean to put onto .com onto .net, and you're gettin internal errors on .net because of that.
0
scottyh56Author Commented:
I've now deleted the file I've been playing with from .net and you can now see the .net site.

If you go to www.scottyh.com you'll see how the .htaccess file works fine there, taking you to .net.

The two sites are completely different hosts.

There is something strange going on here I know, but I know not what it is....
0
scottyh56Author Commented:
Changed scottyh.com now to:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?scottyh\.com
RewriteRule ^.* http://www.lighttouchimages.co.uk/index.htm [R=301,L]

Works fine. So why not on .net???
0
RoshaoarCommented:
some hosts do disallow stuff like this

presumably the .net one is

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?scottyh\.net
RewriteRule ^.* http://www.lighttouchimages.co.uk/index.htm [R=301,L]

right?


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RoshaoarCommented:
hm, try giving pipex a call in the am. From this chart it looks like there might be some domain confusion - you have the same one twice?

http://uptime.netcraft.com/up/hosted?netname=UK-PIPEX-LEEDS-DCO-1,81.21.75.0,81.21.75.127
0
scottyh56Author Commented:
Yes - not there now but it has been in that form (and the others above) and not worked.

I've put in a support request to the host.

I'll be putting the .htaccess file back shortly in the form in the last post so they can see the effect.
0
caterham_wwwCommented:
Different servers (at least from your http response headers), different settings... your rule posted in your initial posting would be correct, but since nothing happens you may not be allowed to use directives which override FileInfo on that host. In other words: The configuration of that server does not permit those directives in a .htaccess file, they are simply ignored.

> it should be set at 755

Why? Apache needs read permissions only, 644 should be fine. There's no need for write or execute permissions for apache or world (but write for the owner in order to edit the file).
0
scottyh56Author Commented:
OK - the host has my email - perhaps they will be able to fix.

If they can't then what is the alternative for a 301 redirect of all traffic looking for www.scottyh.net or files in www.scottyh.net?

I could clear everything out and put up index.php with a php redirect but that would not nail people looking for www.scottyh.net/index.htm etc

Thanks
0
caterham_wwwCommented:
> I could clear everything out and put up index.php with a php redirect but that would not nail people looking for www.scottyh.net/index.htm etc

Yes, that would be an option.

ErrorDocument 404 http://example.com  (will issue a 302 redirect)   or
ErrorDocument 404 /index.php   and send a 301 via php

would be another option. But ErrorDocument overrides FileInfo, too, so that won't work as well if AllowOverride is not set to FileInfo in httpd.conf/server configuration.
0
scottyh56Author Commented:
the host has confirmed that it's their server settings causing the problem.

I've set a php redirect in index.php as follows:

<?
header( "HTTP/1.1 301 Moved Permanently" ); //the original page was http://www.scottyh.net/index.htm
header( "Location: http://www.lighttouchimages.co.uk" );
exit();
?>

which seems to work fine and has the benefit of allowing people to still go direct to old galleries on the site.

I've allocated some points.

Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.