How can I create a redirect for Apache 2.2 webserver on Windows-7

1

I'd like to have a redirection web page from one page to another so that I can have two names for the same web page on my server. I tried creating a windows shortcut, but that did not work. Please suggest how to have one page be a pointer to another.

WilliamKF

Posted 2010-01-30T23:42:51.180

Reputation: 6 916

Answers

1

This is what I ended up doing in my virtual host section of the configuration file:

<VirtualHost *:80>
DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\myDocs"
ServerName www.domain.com
Redirect /index.html http://www.domain.com/anotherLocation
</VirtualHost>

WilliamKF

Posted 2010-01-30T23:42:51.180

Reputation: 6 916

@WilliamKF - was the correct answer then from taspeotis or from you? Appears as though you answered your own question correctly. You should give yourself credit for that. – Patrick – 2010-01-31T02:33:22.000

1

This belongs on Server Fault. This is a server question, regarding Apache running on the Windows platform.

two names for the same web page on my server

What are you trying to do? Are you trying to have Apache serve http://www.domain.com as well as http://domain.com?

If you are trying to have localhost/a.htm and localhost/b.htm point to c.htm you could try mod_alias or mod_rewrite.

ta.speot.is

Posted 2010-01-30T23:42:51.180

Reputation: 13 727

I'm trying to have the following be the same:

http://www.domain.com/directory/index.html
http://www.domain.com/index.html

Without duplicating the page. – WilliamKF – 2010-01-31T00:42:33.743

I couldn't get the 'Alias' command to work for me, but the 'Redirect' did work. Think it had to do with permissions. – WilliamKF – 2010-01-31T01:50:40.650