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?
lytung818Asked:
Who is Participating?
 
fridomConnect With a Mentor CEO/ProgrammerCommented:
Everything you can dream of ;-)

No, getting serious. Redirect is just a simply form in an HTML file. So just open an editor and write the code. I doubt very much that you would use ASP for such a task, that would be overkill.

In the end the only that you write is something along the following lines:
<a href="http://www.q-software-solutions.com/aserve/store/index.html">Store</a>.
</p>
    <meta http-equiv="Refresh" Content="10
    URL=http://www.q-software-solutions.com/aserve/store/index.html">
Or somethong like that.


Regards
Friedrich
0
 
ahoffmannCommented:
> .. 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
0
 
lytung818Author Commented:
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!
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
lytung818Author Commented:
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!!!
0
 
ahoffmannConnect With a Mentor Commented:
> can this be faster?

replace 10 by 0
;-)

0
 
TintinConnect With a Mentor Commented:
Relying on HTML metaredirects is not reliable.  You are much better to server HTTP redirects.  This can be acheived by:

1.  Adding a redirect in the web server configuration (as ahoffman mentioned)
2.  Generating a HTTP redirect from a SSI, CGI, JSP or ASP page (yes, you can do ASP on Linux, but probably not worth the effort).
0
 
lytung818Author Commented:
well i tried with the metadirects, still very slow.

how do i do #1 that you suggested, tintin?
0
 
lytung818Author Commented:
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
0
 
TintinCommented:
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.
0
 
lytung818Author Commented:
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
0
 
ahoffmannCommented:
> 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)
0
 
pjedmondConnect With a Mentor Commented:
I'm a 1and1 user, and unless you've got a dedicated server, you will not have access to the http.conf file.

The only option that you really have available is the:

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

approach.

However, from the 'elegance' perspective, using the server to issue the redirect is preferred. Look here for an explaination of the reason:

http://www.w3.org/QA/Tips/reback
0
 
ahoffmannCommented:
> 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)
0
 
lytung818Author Commented:
wow, thank you. i think it would be better to host it on ms hosting server...i just switch from that.
0
 
pjedmondCommented:
>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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.