Link to home
Start Free TrialLog in
Avatar of lytung818
lytung818

asked on

programming languages on linux server

i am new to linux and i would like to write a simple script to redirect the page to another server. In an Microsft platform i would use asp, what would i write in a linux server?
Avatar of ahoffmann
ahoffmann
Flag of Germany image

> .. write a simple script to redirect the page to another server ..
are you talking about web servers?
What do you mean by "redirekt"? could you please explain.

As it is Linux, assuming apache as webserver and you mean redirect a HTTP request:
then simply add to you /etc/httpd.conf and restart apache:

  Redirect  permanent /whateverfolderorfile http://new.other.tld/path/file
ASKER CERTIFIED SOLUTION
Avatar of F. Dominicus
F. Dominicus
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lytung818
lytung818

ASKER

okay. In microsoft asp, i would create an asp file, then put:

<%

response.redirect "http://www.yahoo.com"

%>

I want to redirect the page to another server. I have never used a linux server so i dont know how to redirect at all...can i still use asp pages on linux ? or should i be using jsp? i have no clue!  please help!
i wrote

  <meta http-equiv="Refresh" Content="10
    URL=http://www.q-software-solutions.com/aserve/store/index.html">

on the top of the page. It did work but it took a while. can this be faster? Thanks!!!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
well i tried with the metadirects, still very slow.

how do i do #1 that you suggested, tintin?
sorry for asking stupid questions. I have no idea what this means:


from ahoffman:

then simply add to you /etc/httpd.conf and restart apache:

  Redirect  permanent /whateverfolderorfile http://new.other.tld/path/file
ahoffman's description is a bit brief as we don't know for sure if you have Apache, but I think we can be 99.99% certain you do.  Unfortunately, you didn't mention which Linux distribution you are running, so the Apache configuration file maybe elsewhere like /etc/httpd/conf/httpd.conf


See http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect for specific details.
i see how do i know where the .conf file is? i am hosting the website somewhere else. I looked at the directory of the files , no .conf file

this is the package i have

http://order.1and1.com/xml/order/HostingBeginner;jsessionid=0D663B24589C990ACB5872D23428EF67.TC61a
> Relying on HTML metaredirects is not reliable.  You are much better to server HTTP redirects.
meta tags are as unreliable as the HTTP location header 'cause both are done by the client

> ahoffman's description is a bit brief  ..
for sure, but I wrote down all my assumtions (Linux, apache, ...), very unusual for my comments ;-)

> .. how do i know where the .conf file is?
sorry, do you have problems in reading? --> http:#16990132 tells you /etc/httpd.conf
depending on your distribution it might be somewhere else, there're dozent of usual places (unfortunatelly)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> I'm a 1and1 user, ..
bad luck ;-)

Redirect can only be used in httpd.conf, IIRC
but mod_rewrite can be used in .htaccess too (but it's a performance penulty for obvious reason)
wow, thank you. i think it would be better to host it on ms hosting server...i just switch from that.
>i think it would be better to host it on ms hosting server

Depends. You've got all sorts of differences things to weigh up.

Reliability
Security
Performance
Compatability
etc