Solved

programming languages on linux server

Posted on 2006-06-26
15
257 Views
Last Modified: 2010-04-21
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?
0
Comment
Question by:lytung818
  • 6
  • 4
  • 2
  • +2
15 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16990132
> .. 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
 
LVL 24

Accepted Solution

by:
fridom earned 100 total points
ID: 16990139
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
 

Author Comment

by:lytung818
ID: 16990141
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:lytung818
ID: 16990211
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
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 50 total points
ID: 16990314
> can this be faster?

replace 10 by 0
;-)

0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 50 total points
ID: 16997753
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
 

Author Comment

by:lytung818
ID: 16998472
well i tried with the metadirects, still very slow.

how do i do #1 that you suggested, tintin?
0
 

Author Comment

by:lytung818
ID: 16998506
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
 
LVL 48

Expert Comment

by:Tintin
ID: 16998535
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
 

Author Comment

by:lytung818
ID: 16998703
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16998924
> 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
 
LVL 22

Assisted Solution

by:pjedmond
pjedmond earned 50 total points
ID: 17003772
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17003844
> 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
 

Author Comment

by:lytung818
ID: 17004270
wow, thank you. i think it would be better to host it on ms hosting server...i just switch from that.
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17004434
>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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mounting Linux Partition.... 30 371
Problem to run file 9 130
Linux "time" command output redirection 16 224
Linux Scripting 3 169
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question