Forum Moderators: phranque

Message Too Old, No Replies

Confused about redirect

         

jadedev

6:06 am on Nov 14, 2007 (gmt 0)

10+ Year Member



I have been researching redirect. I read you can configure httpd.conf to redirect URL.

example:

I want to redirect www.domain.com to www.domain.com/cart/index.php

So in the httpd.conf file, I created an entry at the very bottom of the file.

redirect /index.html [domain.com...]

When I open IE, the cart page comes up. Me very happy but the pictures of the products that i've loaded into the cart are not displaying. Weird.

Then I comment off the entry in httpd.conf and restart apache, and the pictures still won't come up. Yikes

phranque

6:24 am on Nov 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



make sure to clear cache before retesting your configuration changes.

jadedev

6:42 am on Nov 14, 2007 (gmt 0)

10+ Year Member



you mean pressing control-F5 for IE to reload the page?

jdMorgan

6:44 am on Nov 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, you'll need to completely clear the cache using Internet Options.

Jim

phranque

6:49 am on Nov 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



i believe in ie it would be something in "internet options" like "delete temporary internet files" or equivalent.
i guess "cache" is too technical of a term for the target market...

jadedev

7:06 am on Nov 14, 2007 (gmt 0)

10+ Year Member



absolutely weird. In internet options, I deleted cookies, delete files, clear history. But the same thing. So I disabled proxy server and use localhost to access my page and everything comes up, weird. And now everything comes up with proxy server too. extra weird.

Now back to my main concern. Is redirecting in httpd.conf the right way to do things? Seemed to work but doesn't load the pictures.

I read I can use .htacess in apache rootdocument directory. So I created such a file and apache stopped working, so double yikes. I am staying away from that.

phranque

11:00 am on Nov 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



cache is cache.
it all must be cleared when testing these changes.
you probably cleared the proxy server's cache and that's why it now works.

most things you do in httpd.conf can also be done in .htaccess but there are often subtle differences in how or why.
some not so subtle - if you were on shared hosting you typically wouldn't get near httpd.conf for obvious reasons.

whatever you are doing has been done before and with enough information we can figure out how to fix it.
a good place to start would be the error and access logs.
what are they telling you about referred access to image file urls?
have you tried directly entering the absolute url of an image file in your browser?
are there any directives in httpd.conf that may affect image files or directories (or in any .htaccess file(s) in the image directory or any of its parents)?

jadedev

2:10 pm on Nov 16, 2007 (gmt 0)

10+ Year Member



Hi Guys,

i think I figured out the reason why the pictures didn't load. problem solved.

Now I still haven't gotten to the bottom of this. I want to direct www.domain.com to www.domain.com/index.php. I read there are many ways to do this in Apache and it's confused me.

jadedev

2:40 pm on Nov 16, 2007 (gmt 0)

10+ Year Member



UPDATE UPDATE

In the httpd.Conf file. I did this and it worked. So happy

<Directory "C:/directory">
Redirect permanent /index.html [domain.com...]
</Directory>