Elham_Seif
asked on
Error in redirect
I'm using an open source eclup(Elgg), when I wanne to run and view it in my browser, it won't work.
I checked the logs and I found the error in the "apache_error" file:
"[error] [client 127.0.0.1] cannot redirect '/elgg1.6.1' to 'index.php'; target is not a valid absoluteURI or abs_path, referer: http://localhost/ "
I'm new in PHP and open source projects, please help me to fix this. Thanks.
I checked the logs and I found the error in the "apache_error" file:
"[error] [client 127.0.0.1] cannot redirect '/elgg1.6.1' to 'index.php'; target is not a valid absoluteURI or abs_path, referer: http://localhost/ "
I'm new in PHP and open source projects, please help me to fix this. Thanks.
please post the corresponding RewriteRule directive from your httpd.conf and/or .htaccess file (please do not post the complete httpd.conf, just the Rewrite* lines)
ASKER
I just find the .htaccess file:
"
RewriteRule ^action\/([A-Za-z0-9\_\-\/ ]+)$ engine/handlers/action_han dler.php?a ction=$1
RewriteRule ^export\/([A-Za-z]+)\/([0- 9]+)$ services/export/handler.ph p?view=$1& guid=$2
RewriteRule ^export\/([A-Za-z]+)\/([0- 9]+)\/$ services/export/handler.ph p?view=$1& guid=$2
RewriteRule ^export\/([A-Za-z]+)\/([0- 9]+)\/([A- Za-z]+)\/( [A-Za-z0-9 \_]+)\/$ services/export/handler.ph p?view=$1& guid=$2&ty pe=$3&idna me=$4
RewriteRule ^\_css\/css\.css$ _css/css.php
RewriteRule ^pg\/([A-Za-z0-9\_\-]+)\/( .*)$ engine/handlers/pagehandle r.php?hand ler=$1&pag e=$2
RewriteRule ^pg\/([A-Za-z0-9\_\-]+)$ engine/handlers/pagehandle r.php?hand ler=$1
RewriteRule xml-rpc.php engine/handlers/xml-rpc_ha ndler.php
RewriteRule mt/mt-xmlrpc.cgi engine/handlers/xml-rpc_ha ndler.php
RewriteRule ^tag/(.+)/?$ engine/handlers/pagehandle r.php?hand ler=search &page=$1
"
Is that you mean?
"
RewriteRule ^action\/([A-Za-z0-9\_\-\/
RewriteRule ^export\/([A-Za-z]+)\/([0-
RewriteRule ^export\/([A-Za-z]+)\/([0-
RewriteRule ^export\/([A-Za-z]+)\/([0-
RewriteRule ^\_css\/css\.css$ _css/css.php
RewriteRule ^pg\/([A-Za-z0-9\_\-]+)\/(
RewriteRule ^pg\/([A-Za-z0-9\_\-]+)$ engine/handlers/pagehandle
RewriteRule xml-rpc.php engine/handlers/xml-rpc_ha
RewriteRule mt/mt-xmlrpc.cgi engine/handlers/xml-rpc_ha
RewriteRule ^tag/(.+)/?$ engine/handlers/pagehandle
"
Is that you mean?
yes, that's what I mean.
The rules look fine to me.
Are there other hints in your error_log file?
Can you please post th eURL you used in your browser.
The rules look fine to me.
Are there other hints in your error_log file?
Can you please post th eURL you used in your browser.
ASKER
The eURL I'm using is:"http://localhost/elgg1.6.1"
And I didn't find any other error related to this.
And I didn't find any other error related to this.
this URL soes not match any of the posted rewrite rules
As the rewrite rules are all from a .htaccess file, you need to check your httpd.conf (which should not be a problem as it is localhost:)
As the rewrite rules are all from a .htaccess file, you need to check your httpd.conf (which should not be a problem as it is localhost:)
ASKER
I can't find the httpd.conf file. Where should it be? Can I Creat it ?
> Where should it be?
depends on your distribution
ps ax |grep httpd
or
ps -el |grep httpd
should show how httpd ist started, most likely with the -c option telling where to find the configuration file
> Can I Creat it ?
why? it's already there, otherwise your apache won't run proper.
depends on your distribution
ps ax |grep httpd
or
ps -el |grep httpd
should show how httpd ist started, most likely with the -c option telling where to find the configuration file
> Can I Creat it ?
why? it's already there, otherwise your apache won't run proper.
This is not an issue of mod_rewrite and RewriteRules, it's one of mod_alias and its Redirect directives.
The error is by bad design of your open source software used. They use
# ugly ugly hack to detect missing mod_rewrite
# RedirectMatch must be to an absolute destination, so forces 500 error...
ErrorDocument 500 "Elgg error: Apache does not have mod_rewrite loaded. Please check your Apache setup."
RedirectMatch 302 .* index.php
They're creating an internal server error with the invalid RedirectMatch syntax to point out (with the ErrorDocument directive) that the module mod_rewrite is missing.
The error is by bad design of your open source software used. They use
# ugly ugly hack to detect missing mod_rewrite
# RedirectMatch must be to an absolute destination, so forces 500 error...
ErrorDocument 500 "Elgg error: Apache does not have mod_rewrite loaded. Please check your Apache setup."
RedirectMatch 302 .* index.php
They're creating an internal server error with the invalid RedirectMatch syntax to point out (with the ErrorDocument directive) that the module mod_rewrite is missing.
ASKER
I can't Understad. Now What I can do?
Load the module mod_rewrite into your server configuration. The first step is to locate your httpd.conf as pointed out by ahoffmann if you don't know its location.
ASKER
Finally I find the httpd.conf files!
1-C:\Program Files\EasyPHP5.3.0\conf_fi les
2-C:\Program Files\EasyPHP5.3.0\apache\ conf
3-C:\wamp\bin\apache\Apach e2.2.11\co nf
4-C:\wamp\bin\apache\Apach e2.2.11\co nf\origina l
Which one And which part of that should I check?
1-C:\Program Files\EasyPHP5.3.0\conf_fi
2-C:\Program Files\EasyPHP5.3.0\apache\
3-C:\wamp\bin\apache\Apach
4-C:\wamp\bin\apache\Apach
Which one And which part of that should I check?
I guess httpd.conf should be in 3.
But as it is apache 2.2, you most likely have some more files included there. See the Include directive in httpd.conf where these files are to be found.
But as it is apache 2.2, you most likely have some more files included there. See the Include directive in httpd.conf where these files are to be found.
ASKER
The files ..
1-C:\Program Files\EasyPHP5.3.0\conf_fi les
my.Configuration Settings
php.Configuration Settings
httpd.conf 40kb
2-C:\Program Files\EasyPHP5.3.0\apache\ conf
extra (folder)
openssl (SpeedDail)
charset.conv
mime.types
magic
httpd.conf 41kb
3-C:\wamp\bin\apache\Apach e2.2.11\co nf
extra (folder)
original (folder)
openssl (SpeedDail)
charset.conv
mime.types
magic
httpd.conf 18kb
4-C:\wamp\bin\apache\Apach e2.2.11\co nf\origina l
extra (folder)
charset.conv
mime.types
magic
httpd.conf 18kb
1-C:\Program Files\EasyPHP5.3.0\conf_fi
my.Configuration Settings
php.Configuration Settings
httpd.conf 40kb
2-C:\Program Files\EasyPHP5.3.0\apache\
extra (folder)
openssl (SpeedDail)
charset.conv
mime.types
magic
httpd.conf 41kb
3-C:\wamp\bin\apache\Apach
extra (folder)
original (folder)
openssl (SpeedDail)
charset.conv
mime.types
magic
httpd.conf 18kb
4-C:\wamp\bin\apache\Apach
extra (folder)
charset.conv
mime.types
magic
httpd.conf 18kb
you have three choices, ask the person who installed the software ;-)
Don't have my crystall ball handy, sorry.
Don't have my crystall ball handy, sorry.
ASKER
OK,
What should I check in httpd.conf? ,Is there somting to load to it?
What should I check in httpd.conf? ,Is there somting to load to it?
please post all Redirect* and Rewrite* directive (just the active ones, not the comment out ones)
ASKER
LoadModule rewrite_module modules/mod_rewrite.so
I just find this. But there wasn't any active Redirect module.
I just find this. But there wasn't any active Redirect module.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I searched in included files, but didn't find any thing.
ASKER
Untill now I was seen "HTTP 500 - Internal server error" when I click on my eclub name,
2 min ago I add "Redirect /elgg1.6.1 http://localhost/elgg1.6.1/index.php" to the . htaccess file and find the page as below:
"The page cannot be displayed"
...
"Cannot find server or DNS Error "
What are these saying?
2 min ago I add "Redirect /elgg1.6.1 http://localhost/elgg1.6.1/index.php" to the . htaccess file and find the page as below:
"The page cannot be displayed"
...
"Cannot find server or DNS Error "
What are these saying?
ASKER
>> ... mod_rewrite.so
>If I look at your other comments, you're on a windoze system, but this line tries to load a UNIX shared >object library. Sounds like you have a misconfigured file for your system.
--What can I do for it?!
>If I look at your other comments, you're on a windoze system, but this line tries to load a UNIX shared >object library. Sounds like you have a misconfigured file for your system.
--What can I do for it?!
ASKER
Finally My web site loaded.
I copy this to httpd.conf and it worked.
LoadModule rewrite_module modules/mod_rewrite.so
<Directory />
AllowOverride All
</Directory>
I copy this to httpd.conf and it worked.
LoadModule rewrite_module modules/mod_rewrite.so
<Directory />
AllowOverride All
</Directory>
ASKER
Thanks for your help.