|
See the thread you created right after posting this.
|
|
|
|
|
hi
i am new to linux os. i want to install emax.
i have downloaded the tar.gz files. the how to install these file
by
paul
|
|
|
|
|
Start by unzipping the tar.gz, then there should be a text file called INSTALL or README or somthing like that that will give you detailed instructions on what to do.
If your distro has a package manager available it'd be better to use that to install stuff than to do it manually.
|
|
|
|
|
I'd be surprised if you don't already have it installed. try running it from a terminal
|
|
|
|
|
hi there,
my rewriterule with a condition is working fine as below:
http://www.sitename.com/index.php?n=text redirects to
http://www.sitename.com/pages/text with a little problem explained below.
and the page renders properly, however, there is a problem that with the redirected URL the arguments are also added to the URL. So actually in address bar it looks like-
http://www.sitename.com/pages/text?n=text
This is bugging me. The part '?n=text' should not come. Could anyone help me on this? The htaccess code is given below.
RewriteCond %{QUERY_STRING} ^n=(.*)$
RewriteRule index.php http://www.sitename.com/pages/%1 [r=301,nc]
Thanks in advance!
Aditya
Aditya
modified on Monday, March 30, 2009 1:11 AM
|
|
|
|
|
I'm afraid I cant help you with the Rewrite rule. But seeing as you are using PHP couldn't you just use that?
<?php
header ("Location: http://www.sitename.com/pages/".$_GET['n']);
?>
Neonlight
|
|
|
|
|
hey neonlight,
that seems to be a nice suggestion, thank you! however, i have got the problem fixed in htaccess itself.
modified code is -
RewriteCond %{QUERY_STRING} ^n=(.*)$<br />
RewriteRule index\.php http:
cheers,
adi
Aditya
|
|
|
|
|
hidden (htaccess rewritten) URL (X) - www.sitename.com/index.php?id=123
actual url (Y) - www.sitename.com/index/id/123
so far the URL X is used, but for security and url cleaning i want to use the URL Y
I want to know - should i place a permanent redirect for the URL X that is so far cached by search engines? Is that preferrable? I want to update the World with the URL Y. and want to remove the URL X frm internet world.
I am also concerned regarding the page ranking that the URL X have gotten so far.
i hope i am clear with the question.
any suggestions would be appreciated!
thanks
Aditya
Find tips and tricks on http://www.easytipsandtricks.com
|
|
|
|
|
hello,
if a website has its address like -
www.name.com/index.php?name=a-ab-abc
depending upon the value of the parameter 'name' the contents in the website are displayed. If name value is invalid or not in database, php script INCLUDES an error-message php file in the same index.php?name=a-ab-abc stating that its a 404 page not found. However my concern is how the search engines treat this like? Does it treat the page as same 404 page not found or it treats as normal page?
cheers
Aditya
|
|
|
|
|
I think if you uploaded a sitemap and informed google of it using webmaster tools, it would index your site ok.
If you are refernceing pages stored in a DB: I've had this issue come up before and never really found a solution - I tend to make an actual page for every page now and use a sitemap where neccessary.
If the pages actually exist but naviagtion is completed through queries (not hyperlinks) - the engines will find it harder to 'weigh' your pages - but the sitemap will help it find them and weigh them. It's a start.
As for the code as long as a page is found it should return 200. However you can send custom headers (ie 404 for missing pages) using php. Look up "header" in the php manual.
|
|
|
|
|
Thanks for the detailed reply mate!
neonlight27 wrote: I think if you uploaded a sitemap and informed google of it using webmaster tools, it would index your site ok.
I have uploaded sitemap to search engines however when i checked my page on the HTTP Status Checker tool it returned me 200 OK Status - that should be obvious because the default.php existed just that the page contents are changed to show user a page not found messsage.. but i wonder how the search engine is treating this request..
also i tried modifying the header but either got a warning that header was already sent or even when the header() code was there, the page gave 200 OK status message
Aditya
Find tips and tricks on http://www.easytipsandtricks.com
|
|
|
|
|
You need to send headers first. I.E :
<?php
session_start();
$pageExists = false; //try changing to true
if ($pageExists == false){
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found"); //in case the above doesn't work
flush(); //send headers
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>Hello World!
</body>
</html>
<?php } ?>
Neonlight
|
|
|
|
|
thanks for the reply mate.. i would try this and come back again if required... thanks for your efforts!
cheers,
aditya
Aditya
Find tips and tricks on http://www.easytipsandtricks.com
|
|
|
|
|
Hats Off to you! It worked, you're a genuious!
Thanks again!
Aditya
Find tips and tricks on http://www.easytipsandtricks.com
|
|
|
|
|
|
|
I was given a HW assignment that I am having a lot of trouble on.
I must have missed the day the teacher explained all of this because I have nothing on this material other than google...It's not even in the text.
here is the problem
Write a C-program that does the following:
The program first creates a single pipe, using the pipe() system call. It then forks a child process
using the fork() call. The goal is to share the work of counting numbers that are multiples of 3
and 5 from the set of integers from 1-10000. The parent process executes the for-loop (from
1-10000) and takes the responsibility for counting all multiples of 5. All numbers that are not
multiple of 5 are passed through the pipe to the child process to be inspected and counted if they
are multiples of 3. Note: Only the parent process will implement the for-loop from 1-10000. After
the processes have completed their work, both, parent and child will print out a corresponding
message together with their corresponding process-id. The child then uses the pipe to send its
result to the parent. Upon reading the number of multiples of 3 from the pipe, the parent will print
out the complete response to the user (i.e., count of multiples of 3 and 5) and wait for the child to
exit properly and exit.
What happens if the child process is executing significantly slower than the parent process, i.e.,
what if the parent wants to read from the pipe while the child process has not had a chance to read
all multiples of 3 from it? Describe the problem! Describe how you simulated this problem!
What do you need to do to avoid this problem? Show your solution!
could anyone give me any ideas on how to go about solving this, and how I'm supposed to work with communicating these pipes?
|
|
|
|
|
Can anyone explain what the following regex represents?
my $s = "1";
if ($s =~ /[1-4[a-b]]/)
{
print "yes\n";
}
else
{
print "no\n";
}
The above when run using v5.10.0 runs without a problem and produces "no" for the answer.
Note I am NOT interested in answers about modifying the regex. I know that if I modified the regex to something like [1-4] it would produce yes.
I am interested in this specific regex and what it represents. My presumption is that since it doesn't produce an error nor warning that it is a valid regex. So what sort of valid regex does it represent?
|
|
|
|
|
well, as far as I can see (and my perl regex may be a bit rusty, as opposed to other regex variants/nuances) :-
[1-4 ]
is a character class, saying that it matches digits 1,2,3,4
now it gets tricky .. I didnt know you could 'nest' character classes, although it obviously compiles..
the
[a-b] 'inside' says, 'only the characters a to b'
I think it could be more simply represented as
[1-4a-b]
and I think thats how the compiler is seeing it, since the inner [, -, ] arnt not being escaped ...
.. hence afaik it matches (returns true), for a single character, that can be one of 1 or 2 or 3 or 4 or a or b (there are no modifiers eg '.' or '+' or '{n,m}' after the spec, indicating 0 or more, 1 or more, or min n, max m characters ...)
Pick up any perl manual or do a google to learn the syntax, then pull a regex apart bit by bit, its not hard ..
'g'
|
|
|
|
|
Garth J Lancaster wrote: I think it could be more simply represented as
[1-4a-b]
Which would seem logical. However running the code demonstrates that is not what it does.
The output is 'no' indicating that it did not match the value '1'.
Obviously your character class would match that.
|
|
|
|
|
jschell wrote: /[1-4[a-b]]/
[] match a single character present in the list below
- a character in the range between "1" and "4"
- the character "["
- a character in the range between "a" and "b"
match the character "]" literally
compliments of RegexBuddy
|
|
|
|
|
JimmyRopes wrote: [] match a single character present in the list below
- a character in the range between "1" and "4"
- the character "["
- a character in the range between "a" and "b"
match the character "]" literally
So it is equivalent to the following.
[1-4\[a-b]\]
That does explain it.
|
|
|
|
|
I am trying to learn some Perl. Suppose that I have a string in a Perl variable called inputLine. I know that the string starts off with a series of digits. I want to extract those digits and store them (as a string) into a variable called num. I am thinking that I can do this with Perl regular expressions. I tried, the following but it did not work:
$_ = inputLine;
num = /d+/;
I am hoping somebody here can tell me the rigth way to do this.
Thanks
Bob
|
|
|
|
|
I think you can do
if ($inputline =~ /(d+)/)
{
my ($num)=$1;
}
so, if inputline (is 1 or more digits) the result is put in match 1 since there's only 1 bracketed term in the expression .. I think $0 contains the full input string ...
'g'
|
|
|
|
|
#! /usr/bin/perl -w
$_ = "123.567isa decent number12456.3";
$num = /\d+/;
print $num;
should only produce a logical value. 1
The $num is using a MATCH operation /\d+/ which should be
written as
$num = m/\d+/;
Thanks Guys/Girls
|
|
|
|