Closed Thread Icon

Topic awaiting preservation: htaccess redirect - why doesn't this work? Pages that link to <a href="https://ozoneasylum.com/backlink?for=12752" title="Pages that link to Topic awaiting preservation: htaccess redirect - why doesn&amp;#039;t this work?" rel="nofollow" >Topic awaiting preservation: htaccess redirect - why doesn&#039;t this work?\

 
Author Thread
smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-19-2003 20:48

I have tried all the below variations of an htaccess redirect but none work - i always get an internal server error. What am I doing wrong?

Basically in the old design of the site I had a page called gallery.html (http://www.cryokinesis.co.uk/gallery.html)
But in the new design this page no longer exists and I want to send all people with links to that page directly to the main site of http://www.cryokinesis.co.uk but it just wont work, hav I done something wrong? What I don't want to do is set up a new page called gallery.html containing a javascript redirect - I want a proper serverside htaccess fix that will be as nice to search engines and visitors as possible.

Redirect /gallery.html/ http://www.cryokinesis.co.uk/

Redirect gallery.html/ http://www.cryokinesis.co.uk/

Redirect gallery.html http://www.cryokinesis.co.uk/

Redirect gallery.html http://www.cryokinesis.co.uk

Redirect permanent gallery.html http://www.cryokinesis.co.uk

*edit*
sorry, there is loads of links now - i promise it wasn't just a google ploy to boost my rank, I really do have a prblem with this.

[This message has been edited by smonkey (edited 05-19-2003).]

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-19-2003 22:52

I'm pretty sure it should be

Redirect /gallery.html http://www.cryokinesis.co.uk



.:[ Never resist a perfect moment ]:.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-19-2003 23:44

that doesn't work, i'm not sure why - does the gallery.html page actually have to exist? should the htaccess file go in the root directory of the site, or above it if possible? At the moment this is my setup:
www.cryokinesis.co.uk - points to my root web directory
www.cryokinesis.co.uk/gallery.html - this is the page that no longers exists but I want to redirect people from this page should they get to it from an old link on another site.

in my htaccess file I have just that one entry that you have put above and it still doesn't work.
if you could open an htaccess file from a link it would be: www.cryokinesis.co.uk/.htaccess

is there anything wrong with my setup from what you read here?

thanks.

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 05-19-2003 23:49

Sure your server supports it ? *said nicely

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 05-20-2003 01:37

Redirect path url
is the rule

Redirect /gallery.html http://www.cryokinesis.co.uk/

just as Bitdamaged mentioned. You could also use modrewrite to do this, but I suspect that Redirect is better for your application. You could also use a

RedirectPermanent /gallery.html http://www.cryokinesis.co.uk/


bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-20-2003 03:34

If this isn't working then try changing the name of gallery.html to something else. (Like gallery.html.bak) then create a new galler.html page with just this in it's head tag.

<meta http-equiv="refresh" content="0;url=http://www.cryokinesis.co.uk/">

That will redirect from the page



.:[ Never resist a perfect moment ]:.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-20-2003 13:59

hugh: my server supports htaccess just fine, it just doesn't seem to like the redirect, could this have been disabled without disabling the whole of htaccess?

visit my CryoKinesis Online Gallery

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-20-2003 14:04

does it make a differeence that i'm on a virtual server?

I've tried all of your suggestions bar bitdamged last one (this isn't really viable, I don't want to have to create any pages that don't have any real content)

none seem to work, I'm still getting the 'internal server error'.

I have also seen examples of redirectMatch 304 blah blah etc. - can someone explain what this method is about?

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-21-2003 04:51

What directory is the gallery.html file in and what directory is the .htaccess file in?

By directory I mean the local directory not the URL



.:[ Never resist a perfect moment ]:.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-21-2003 08:25

i'm not sure of the exact positon because i don't have access to the everything - what i do have access to is this:

start - 4 folders (certs, logs, users, web)

the web folder is the folder that the domain points to and it contains my website and the .htaccess and it would be where the gallery.html page was if that page still existed but it doesn't (as I said this is the problem - the new design doesn't use the old page)

jiblet
Paranoid (IV) Inmate

From: Minneapolis, MN, USA
Insane since: May 2000

posted posted 05-22-2003 23:19

Use 'pwd' to get the full path.

As for turning off redirects without disabling all of .htaccess, YES it's definitely possible. Either mod_alias could be turned off (unlikely), or the FileInfo is not specified as one of the types of Overrides allowed (somewhat likely). The easiest way to verify this is by looking at the server configuration, but in your case you'll probably have to ask tech support.

Question: does the server error occur whenever you load any page in the directory where the .htaccess file is? Or does it only happen when you request the specific URL you are trying redirect? That will tell you whether the problem is interpreting the .htaccess file or actually performing the redirect itself.

-jiblet

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-23-2003 00:12

to check your path (My dirty method for those without shell access ) is to drop a php page in your root folder with just this

<?
echo getcwd();
?>

which will give you the same results as a 'pwd' command from the shell.





.:[ Never resist a perfect moment ]:.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-23-2003 02:47

I have shell access so here's the path:

/home/sites/site14/web/index.htm - my main page

/home/sites/site14/web/.htaccess - my htaccess file containing the redirect

/home/sites/site14/web/gallery.html - where the gallery page would be if it existed (it doesn't exist any more tho so it's not actually there)

phpmaven
Obsessive-Compulsive (I) Inmate

From: San Clemente, CA, USA
Insane since: May 2003

posted posted 05-23-2003 03:34

smonkey,

I see that you already impemented the javascript redirect on that page. I suspect that your redirect wasn't working because your ISP needs to add something to the Apache http.conf file on their server. You need to ask them to add the following to the <VirtualHost> section of http.conf that apples to your virtual server. They need to add:
<Directory />
AllowOverride All
</Directory>
If that section is not there then you will not be able to use .htaccess to do redirects or anything else for that matter.
The correct line for your .htaccess file would be:
Redirect Permanent /gallery.html http://www.cryokinesis.co.uk
phpmaven

[This message has been edited by phpmaven (edited 05-23-2003).]

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-23-2003 18:29

phpmaven: thanks bud, the trouble is my host claims that all aspects of htaccess should work and in the most part this is true (everything else I've tried to implement with htaccess is just fine, but it's just the redirect thing that isn't working at all - it creates a server error whenever anyone tries to access anything in the folder containing the htaccess file)

I have indeed implemented the javascript redirect method like bitty suggested, it's not ideal tho and search engines don't read it it (so I have included a link on that page and a meta redirect too to assist with this). I am truly perplexed as to what is disallowing my htaccess file to work, from what you guys and my host says it should be fine - which would suggest the error lies with me, but I'm doing everything right, I'm sure of it. Arg.

jiblet
Paranoid (IV) Inmate

From: Minneapolis, MN, USA
Insane since: May 2000

posted posted 05-23-2003 20:44

Well, since you have PHP, you can emulate an Apache redirect by sending a header to the web browser instead of using JavaScript. That will work for search engines too. I'm not sure what all headers Apache would send, but I regularly use the following:

<?php header("Location: http://www.yourdomain.com/url") ?>

Make sure that the <?php is the first thing on the page, as headers can't be sent once output is sent for the page.

-jiblet

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 05-25-2003 01:19

would I not need to use a .php suffix/extension on the html file instead of the current .html extension? because if I do that then gallery.html ceases to exist anyway and I'm back to square one as the chnaces are I can't use htaccess to set the apache to parse all html files for php code.

I have contacted my server in regards to what doesn't appear to be working and I'm hoping they aren't gonna be too pissed off with me (I have contacted them lots so far - they gave me a MySQL password which I was using and couldn't get into my database, then through my own trial and error I discovered that the only way to get into database made by them was to not use any password - ie the one they gave me, which is very bizarre).

Apologies for being a bit highly strung on the other post jiblet, stress and all you kno. I do readily acknowledge the fact that I do tend to exploit the helpful nature of the forum peeps. Not because I'm lazy but because it is less time consuming than spending a few or more weeks reading up. I do want to learn, but I tend to learn best from jumping into complex code and fiddling. I'm not good at building from the ground up.

« BackwardsOnwards »

Show Forum Drop Down Menu