|
|

01-25-2007, 06:53 AM
|
|
Senior Member
|
|
Join Date: Aug 2006
Posts: 67
|
|
Redirect by rewrite & .htaccess
Hello,
When LSWS redirect from one catalog to another, it doesn't check the .htaccess in new directory. e.g.: I have catalog /a/ with .htaccess file. In /a/.htaccess I use mod_rewrite to redirect from /a/info.php to /b/info.php. In catalog /b/ I have .htaccess file with "php_value register_globals off". When I enter /a/info.php then I have register_globals on, but when I enter /b/info.php then the register_globals are off. In Apache register_globals are off for both /a/info.php & /b/info.php.
|

01-25-2007, 08:22 AM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
OK. I will check this.
|

01-25-2007, 09:11 AM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
It works properly with my test case. What is the rewrite rule to redirect /a/info.php to /b/info.php? I wonder if the request got redirected at all.
My rewrite rule in /a/.htaccess
Code:
RewriteEngine on
RewriteRule phpinfo.php /2/phpinfo.php
It performs an internal redirect which does not change the URL in browser, if external redirect is prefered, just add "[R]" to the end of the rewrite rule, same result.
|

01-26-2007, 04:14 AM
|
|
Senior Member
|
|
Join Date: Aug 2006
Posts: 67
|
|
Answer
I checked that and when you redirect from /a/phpinfo.php to /b/phpinfo.php it works, but when your redirect from /phpinfo.php (document_root) to /b/phpinfo.php it doesn't work.
I have files:
public_html/.htaccess:
RewriteEngine on
RewriteRule phpinfo.php /2/phpinfo.php
public_html/2/.htaccess:
php_value register_globals off
public_html/2/phpinfo.php:
<?php
phpinfo();
?>
There is no file public_html/phpinfo.php.
1. When I enter http://domain/phpinfo.php, then register_globals are on (wrong).
2. When I enter http://domain/2/phpinfo.php, then register_globals are off (correct).
3. When I enter http://domain/empty_dir/phpinfo.php, then register_globals are off (correct).
|

01-27-2007, 02:17 AM
|
|
Senior Member
|
|
Join Date: Aug 2006
Posts: 67
|
|
Answer
1. Now .htaccess after redirect works.
2. FrontPage Ext with domain.com still doesn't work. When I copy file /usr/local/frontpage/www.domain.com:80 to /usr/local/frontpage/domain.com:80, then they works.
3. In new version, when I enter LSWS "Control Panel", I have error:
Warning: Invalid argument supplied for foreach() in /usr/local/lsws/admin/html.3.0/classes/ws/Service.php on line 59
|

01-27-2007, 06:59 AM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
For #2, it is a work around as expected. I just wonder why Apache can do it without domain.com:80? I thought it was "UseCanonicalName on", so CGI env SERVER_NAME will be always set to "www.domain.com" when accessed through http://doamin.com/... , and I just added support for UseCanonicalName in LSWS, I wonder why it still does not working. 
We saw #3 problem surfacing sometimes as well, no real harm, but will let web admin developer to take a look. Thanks.
|

01-28-2007, 03:01 AM
|
|
Senior Member
|
|
Join Date: Aug 2006
Posts: 67
|
|
Answer
#2. I have "UseCanonicalName off" for all VH. When I turned it on for one virtual host, then it was working properly (www.domain.com and domain.com). It seems that Apache force UseCanonicalName off for FrontPage Extensions.
|

01-28-2007, 10:58 AM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
I see. I updated the package to force "UseCanonicalName on" for FrontPage Extensions. Please give it a try.
Thanks.
|

01-30-2007, 08:16 AM
|
|
Senior Member
|
|
Join Date: Aug 2006
Posts: 67
|
|
Answer
Now FrontPage Extensions works perfectly at LSWS.
To make it work at cPanel server, admin must execute two shell commands:
Quote:
|
sed -rie 's/(safe_)?chmod\(( )?0600,( )?("\$\{myuid\}",)?( )?"\$(\{)?homedir(\})?\/public_html\$\{subweb\}\/_vti_pvt\/service.pwd"( )?\);/\1chmod(\20644,\3\4\5"$\6homedir\7\/public_html${subweb}\/_vti_pvt\/service.pwd"\8);/' /scripts/fp-auth /usr/local/frontpage/version5.0/apache-fp/fp-auth /usr/local/cpanel/bin/convertfppassthrough /scripts/fixfrontpageperm
|
Quote:
|
/scripts/fixfrontpageperm
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 08:41 PM.
|
|