Htaccess and mod_rewrite in 5,0,2

4 views
Skip to first unread message

Phil

unread,
Feb 4, 2010, 10:05:08 AM2/4/10
to In-Portal Bugs Team
Hello mates,

I've installed a new 502, and I have a problem trying to use htaccess
for mod_rewrite.

This occurs on both Wamp and Lamp servers: when using htaccess,
product details can't display and leads to index page. I've tried to
uncomment lines as indicated in htaccess comments, but it remained the
same.

As I suppose to have a standard configuration (all previous versions
were working), I've posted here...

Thanks.
Phil.

Alexander Obuhovich

unread,
Feb 4, 2010, 10:09:21 AM2/4/10
to in-port...@googlegroups.com
And when mod-rewrite is turned off you got same type of redirect happening? Also you could try to use .htaccess from previous version (4.3.9) of In-Portal.


--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.




--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry A.

unread,
Feb 4, 2010, 10:44:21 AM2/4/10
to In-Portal Bugs Team
I have access to Phil's installation and will test shortly and report
back here.

DA.

On Feb 4, 9:09 am, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> And when mod-rewrite is turned off you got same type of redirect happening?
> Also you could try to use .htaccess from previous version (4.3.9) of
> In-Portal.
>
>
>
>
>
> On Thu, Feb 4, 2010 at 5:05 PM, Phil <p...@domicilis.biz> wrote:
> > Hello mates,
>
> > I've installed a new 502, and I have a problem trying to use htaccess
> > for mod_rewrite.
>
> > This occurs on both Wamp and Lamp servers: when using htaccess,
> > product details can't display and leads to index page. I've tried to
> > uncomment lines as indicated in htaccess comments, but it remained the
> > same.
>
> > As I suppose to have a standard configuration (all previous versions
> > were working), I've posted here...
>
> > Thanks.
> > Phil.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "In-Portal Bugs Team" group.
> > To post to this group, send email to in-port...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > in-portal-bug...@googlegroups.com<in-portal-bugs%2Bunsubscribe@go oglegroups.com>

Dmitry A.

unread,
Feb 4, 2010, 1:50:31 PM2/4/10
to In-Portal Bugs Team
This is really strange since both OLD and NEW .htaccess do the same
thing, but ONLY for Product page or Products category:

"/products.html"

[MY IP] - - [04/Feb/2010:12:44:28 -0600] "GET /5.0.2/products.html
HTTP/1.1" 404 20565 "http://beta.boxer-road.com/5.0.2/" "Mozilla/5.0
(Windo
ws; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko)
Chrome/4.0.249.78 Safari/532.5"
[MY IP] - - [04/Feb/2010:12:44:29 -0600] "GET /5.0.2/themes/advanced/
platform/inc/jquery/thickbox/thickbox.css HTTP/1.1" 304 167 "http://
beta.
boxer-road.com/5.0.2/products.html" "Mozilla/5.0 (Windows; U; Windows
NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.78
Safari/
532.5"
[MY IP] - - [04/Feb/2010:12:44:29 -0600] "GET /5.0.2/themes/advanced/
platform/inc/ajax.js HTTP/1.1" 304 168 "http://beta.boxer-road.com/
5.0.2/
products.html" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.78 Safari/532.5"
[MY IP] - - [04/Feb/2010:12:44:29 -0600] "GET /5.0.2/themes/advanced/
platform/inc/styles.css HTTP/1.1" 304 168 "http://beta.boxer-road.com/
5.0
.2/products.html" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.78 Safari/532.5"
[MY IP] - - [04/Feb/2010:12:44:29 -0600] "GET /5.0.2/themes/advanced/
platform/inc/calendar.js HTTP/1.1" 304 168 "http://beta.boxer-road.com/
5.
0.2/products.html" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.78 Safari/532.5"
[MY IP] - - [04/Feb/2010:12:44:29 -0600] "GET /5.0.2/themes/advanced/
platform/inc/script.js HTTP/1.1" 304 168 "http://beta.boxer-road.com/
5.0.
2/products.html" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.78 Safari/532.5"


Shopping Cart page "/in-commerce/checkout/shop_cart.html":


[MY IP] - - [04/Feb/2010:12:47:49 -0600] "GET /5.0.2/in-commerce/
checkout/shop_cart.html HTTP/1.1" 200 23750 "http://beta.boxer-
road.com/5.0.2
/products.html" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.78 Safari/532.5"
[MY IP] - - [04/Feb/2010:12:47:50 -0600] "GET /5.0.2/themes/advanced/
platform/img/horizontal_dashed_line.gif HTTP/1.1" 304 165 "http://
beta.bo
xer-road.com/5.0.2/in-commerce/checkout/shop_cart.html" "Mozilla/5.0
(Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like
Gecko) Chrom
e/4.0.249.78 Safari/532.5"
[MY IP] - - [04/Feb/2010:12:47:50 -0600] "GET /5.0.2/themes/advanced/
in-commerce/img/shopping_cart_item.gif HTTP/1.1" 304 167 "http://
beta.box
er-road.com/5.0.2/in-commerce/checkout/shop_cart.html" "Mozilla/5.0
(Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like
Gecko) Chrome
/4.0.249.78 Safari/532.5"
[MY IP] - - [04/Feb/2010:12:47:50 -0600] "GET /5.0.2/themes/advanced/
platform/img/delete.gif HTTP/1.1" 304 166 "http://beta.boxer-road.com/
5.0
.2/in-commerce/checkout/shop_cart.html" "Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/
4.0.249.78 Saf
ari/532.5"
[MY IP] - - [04/Feb/2010:12:47:50 -0600] "GET /favicon.ico HTTP/1.1"
404 478 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/
532.5 (KHTML, like Gecko) Chrome/4.0.249.78 Safari/532.5"


Any clues?


Thanks.

Alexander Obuhovich

unread,
Feb 4, 2010, 3:25:08 PM2/4/10
to in-port...@googlegroups.com
I've inspected sql queries a bit and .htaccess is not a problem at all, because for "/products.html" is correctly passed it to index.php for processing.

SQL #1 will find "products" category and it's good:

SELECT CategoryId, SymLinkCategoryId, NamedParentPath
FROM Category
WHERE Status IN
(1,4) AND (LOWER(NamedParentPath) = 'content/products') AND (ThemeId = 1 OR ThemeId = 0)
LIMIT 0,1


SQL #2 won't find any product by "products" keyword and it's also good:

SELECT ci.ItemResourceId, ci.ItemPrefix, c.ParentPath, ci.CategoryId
FROM CategoryItems
AS ci
LEFT JOIN Category
AS c ON c.CategoryId = ci.CategoryId
WHERE
(ci.CategoryId = 2) AND (ci.Filename = 'products')
LIMIT 0,1


SQL #3 is really strange and messes up all detection of category:

SELECT FileId
FROM ThemeFiles
WHERE
(ThemeId = 1) AND (FilePath = '') AND (FileName = 'id.tpl')
LIMIT 0,1


As you can see it tries to find "id.tpl" (don't know anything about it) and fails so it assumes, that current template is not found and leads us to 404 page for both product listing and product detail pages.

Any ideas?

To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Alexander Obuhovich

unread,
Feb 4, 2010, 3:41:47 PM2/4/10
to in-port...@googlegroups.com
What is really strange is that only my local 5.0.2 installation with exactly same database query set I was able to enter category and product details page. So this leads me to conclusion, that PHP version or module set is somehow involved, it's 4.3.9 version there.

Dimitry I propose to debug category/template parsing methods directly on that installation to detect what goes wrong comparing to installation in 5.2+ version of PHP.

Dmitry V. Andrejev

unread,
Feb 4, 2010, 4:54:09 PM2/4/10
to in-port...@googlegroups.com
Hi,


Yes, issue seems to be related how object are handled in PHP 4 and PHP5.

Here we go through all ModRewriteListeners and tricky part that all properly SET $this->_partsFound in PHP5, but it's not working in PHP4.

foreach ($this->Application->RewriteListeners as $prefix => $listener) {
                // set default page
                $vars[$prefix . '_Page'] = 1; // will override page in session in case, when none is given in url

                if ($page_number) {
                    // page given in url - use it
                    $vars[$prefix . '_id'] = 0;
                    $vars[$prefix . '_Page'] = $page_number;
                }
               
                $listener_result = $listener[0]->$listener[1](REWRITE_MODE_PARSE, $prefix, $vars, $url_parts); PROBLEM HERE???
                if ($listener_result === false) {
                               
                    // will not proceed to other methods
                    return true;
                }                   
            }


Thanks.

DA.
-- 
With best regards,

Dmitry V. Andrejev

Alexander Obuhovich

unread,
Feb 5, 2010, 2:23:20 AM2/5/10
to in-port...@googlegroups.com
That's really strange, but kModRewriteHelper object which calls rewrite listeners and kModRewriteHelper object, that is listener are same before that line is called, but after that they have different _partsFound properties. There is somehow object passing by reference problem, because PHP4 needs them, but PHP5 automatically understands where objects are. I've tested various fixes, but none of them worked.

Alexander Obuhovich

unread,
Feb 5, 2010, 12:13:35 PM2/5/10
to in-port...@googlegroups.com
In one place object wasn't assigned by reference and was cloned by the look of PHP 4.3.9 parser. Here patch to fix this. Dimitry please create task in 5.0.3 for this.
404_error_on_category_page.patch

Dmitry A.

unread,
Feb 5, 2010, 3:32:30 PM2/5/10
to In-Portal Bugs Team
Thanks Alex - patch does work well.

1. Here is the task with the patch - will be included into 5.0.3
release

571: Issue with ModRewrite in PHP4 due to improper Reference to
kModRewriteHelper object

http://tracker.in-portal.org/view.php?id=571

2. Phil, we have patched your 5.0.2. installations.

Thanks to all for good work!

DA.

On Feb 5, 11:13 am, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> In one place object wasn't assigned by reference and was cloned by the look
> of PHP 4.3.9 parser. Here patch to fix this. Dimitry please create task in
> 5.0.3 for this.
>

> On Fri, Feb 5, 2010 at 9:23 AM, Alexander Obuhovich <aik.b...@gmail.com>wrote:
>
>
>
> > That's really strange, but kModRewriteHelper object which calls rewrite
> > listeners and kModRewriteHelper object, that is listener are same before
> > that line is called, but after that they have different _partsFound
> > properties. There is somehow object passing by reference problem, because
> > PHP4 needs them, but PHP5 automatically understands where objects are. I've
> > tested various fixes, but none of them worked.
>

> >>>> /products.html <http://road.com/5.0.2%0A/products.html>" "Mozilla/5.0

> >>>http://www.in-portal.com
> >>>http://www.alex-time.com
>
> >> --
> >> Best Regards,
>
> >>http://www.in-portal.com
> >>http://www.alex-time.com
> >> --
> >> You received this message because you
>

> ...
>
> read more »
>
>  404_error_on_category_page.patch
> < 1KViewDownload

Phil

unread,
Feb 5, 2010, 5:38:54 PM2/5/10
to In-Portal Bugs Team
Hello guys,

thank you for your fast fix on this issue !

Cheers,
Phil.

> ...
>
> read more »

Reply all
Reply to author
Forward
0 new messages