You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Petr Hracek <ph...@gmail.com> on 2010/01/11 10:38:39 UTC

[users@httpd] Redirection from DocumentRoot

Hello *,

sorry for bother you with this (may be simple) question but I have following
problem.
Let's say that my document root is situated to the /usr/apache/htdocs/

Is it possible to configure apache so that after accessing to the
DocumentRoot page there
will be done automatic redirection to the /opt/apache/htdocs/testInstall so
that in URL will be seen
e.g. http://<ipadress/testInstall/?

thank you in advance

best regards
Petr

Re: [users@httpd] Redirection from DocumentRoot

Posted by Nilesh Govindarajan <li...@itech7.com>.
On 01/12/2010 01:45 PM, Devraj Mukherjee wrote:
> You can also you use
>
> Alias /testinstall /opt/apache/htdocs/testinstall
>
>
> On Mon, Jan 11, 2010 at 8:38 PM, Petr Hracek<ph...@gmail.com>  wrote:
>> Hello *,
>>
>> sorry for bother you with this (may be simple) question but I have following
>> problem.
>> Let's say that my document root is situated to the /usr/apache/htdocs/
>>
>> Is it possible to configure apache so that after accessing to the
>> DocumentRoot page there
>> will be done automatic redirection to the /opt/apache/htdocs/testInstall so
>> that in URL will be seen
>> e.g. http://<ipadress/testInstall/?
>>
>> thank you in advance
>>
>> best regards
>> Petr
>>
>>
>>
>
>
>

But that wouldn't redirect. He wants to display a different URL in the 
addressbar.

-- 
Nilesh Govindarajan
Site & Server Adminstrator
www.itech7.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Redirection from DocumentRoot

Posted by Petr Hracek <ph...@gmail.com>.
Unfortunatelly I do not have any idea how to use Alias for redirecting page
so the URL in web browser will be changed as well.

Could you please send me a short example?

best regards
Petr

2010/1/12 Devraj Mukherjee <de...@gmail.com>

> You can also you use
>
> Alias /testinstall /opt/apache/htdocs/testinstall
>
>
> On Mon, Jan 11, 2010 at 8:38 PM, Petr Hracek <ph...@gmail.com> wrote:
> > Hello *,
> >
> > sorry for bother you with this (may be simple) question but I have
> following
> > problem.
> > Let's say that my document root is situated to the /usr/apache/htdocs/
> >
> > Is it possible to configure apache so that after accessing to the
> > DocumentRoot page there
> > will be done automatic redirection to the /opt/apache/htdocs/testInstall
> so
> > that in URL will be seen
> > e.g. http://<ipadress/testInstall/?
> >
> > thank you in advance
> >
> > best regards
> > Petr
> >
> >
> >
>
>
>
> --
> Follow me on Twitter, http://twitter.com/mdevraj
>
> "The secret impresses no-one, the trick you use it for is everything"
> - Alfred Borden (The Prestiege)
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Redirection from DocumentRoot

Posted by Devraj Mukherjee <de...@gmail.com>.
You can also you use

Alias /testinstall /opt/apache/htdocs/testinstall


On Mon, Jan 11, 2010 at 8:38 PM, Petr Hracek <ph...@gmail.com> wrote:
> Hello *,
>
> sorry for bother you with this (may be simple) question but I have following
> problem.
> Let's say that my document root is situated to the /usr/apache/htdocs/
>
> Is it possible to configure apache so that after accessing to the
> DocumentRoot page there
> will be done automatic redirection to the /opt/apache/htdocs/testInstall so
> that in URL will be seen
> e.g. http://<ipadress/testInstall/?
>
> thank you in advance
>
> best regards
> Petr
>
>
>



-- 
Follow me on Twitter, http://twitter.com/mdevraj

"The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Redirection from DocumentRoot

Posted by Petr Hracek <ph...@gmail.com>.
I have tried your proposal but it returns during the restarting of
apache2.2:
Redirect to non-URL.

Unfortunatelly I do not know the name of the server, respectively URL is
always based on the IP address on the machine. E.g. http://<IP_address>/....

2010/1/11 Nilesh Govindarajan <li...@itech7.com>

> On 01/11/2010 03:08 PM, Petr Hracek wrote:
>
>> Hello *,
>>
>> sorry for bother you with this (may be simple) question but I have
>> following problem.
>> Let's say that my document root is situated to the /usr/apache/htdocs/
>>
>> Is it possible to configure apache so that after accessing to the
>> DocumentRoot page there
>> will be done automatic redirection to the /opt/apache/htdocs/testInstall
>> so that in URL will be seen
>> e.g. http://<ipadress/testInstall/?
>>
>> thank you in advance
>>
>> best regards
>> Petr
>>
>>
>>
> You can have a host (or vhost) with only 1 docroot. You can create a
> symlink to /opt/apache/htdocs/testInstall in /usr/apache/htdocs -
>
> ln -svt /usr/apache/htdocs /opt/apache/htdocs/testInstall
>
> Then configure apache like this -
>
>        <Directory /usr/apache/htdocs>
>
>                Options +FollowSymLinks
>
>        </Directory>
>
>        RedirectPermanent / /testInstall
>
> --
> Nilesh Govindarajan
> Site & Server Adminstrator
> www.itech7.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Redirection from DocumentRoot

Posted by Nilesh Govindarajan <li...@itech7.com>.
On 01/11/2010 03:08 PM, Petr Hracek wrote:
> Hello *,
>
> sorry for bother you with this (may be simple) question but I have
> following problem.
> Let's say that my document root is situated to the /usr/apache/htdocs/
>
> Is it possible to configure apache so that after accessing to the
> DocumentRoot page there
> will be done automatic redirection to the /opt/apache/htdocs/testInstall
> so that in URL will be seen
> e.g. http://<ipadress/testInstall/?
>
> thank you in advance
>
> best regards
> Petr
>
>

You can have a host (or vhost) with only 1 docroot. You can create a 
symlink to /opt/apache/htdocs/testInstall in /usr/apache/htdocs -

ln -svt /usr/apache/htdocs /opt/apache/htdocs/testInstall

Then configure apache like this -

	<Directory /usr/apache/htdocs>
		
		Options +FollowSymLinks
	
	</Directory>

	RedirectPermanent / /testInstall

-- 
Nilesh Govindarajan
Site & Server Adminstrator
www.itech7.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org