Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

[RESOLVED] Arrgh - url rewrite forwarding to ssl
 
ButterfliesForRelease
Jr. Member
 
Avatar
Total Posts:  25
Joined:  2008-11-16
Brooker, FL
 

From my modules config.xml

<rewrite>
    <
wwb_photos_page>
        <
from><![CDATA[#^/album/([0-9]*)$#]]></from>
        
<to>/photos/index/index/page/$1</to>
    </
wwb_photos_page
</
rewrite>

The problem is that when I go to:
http://www.my_domain.com/album/2

I get forwarded to
https://www.my_domain.com/index.php/photos/index/index/page/2 (This does work, but i want clean urls)

However, if I go to:
https://www.my_domain.com/album/2
http://www.my_domain.com/album
http://www.my_domain.com/album?page=2

All stay on the correct url…

The only time I have a problem is on the album pages that have parameters in the url and are not secure… AKA, anything that goes through the rewriting in my modules config.xml and is not https… for some reason anything that goes through that rewriting is forwarded to a secure url.

Any suggestions?

================================================================================
Fix Below
================================================================================

<frontend>
        <
routers>
            <
photos>
                <use>
standard</use>
                <
args>
                    <
module>WWB_Photos</module>
                    <
frontName>photos</frontName>
                </
args>
            </
photos>
        </
routers>
    </
frontend>
    <
admin>
       <
routers>
            <
photos>
                <use>
admin</use>
                <
args>
                    <
module>WWB_Photos</module>
                    <
frontName>photos</frontName>
                </
args>
            </
photos>
        </
routers>
    </
admin>

The problem was simple when I figured it out at last. The front name for both the admin and the frontend are the same.

I changed the admin from:

<admin>
    <
routers>
        <
photos>
            <use>
admin</use>
            <
args>
                <
module>WWB_Photos</module>
                <
frontName>photos</frontName>
            </
args>
        </
photos>
    </
routers>
</
admin>

to:

<admin>
    <
routers>
        <
photos>
            <use>
admin</use>
            <
args>
                <
module>WWB_Photos</module>
                <
frontName>adminphotos</frontName>
            </
args>
        </
photos>
    </
routers>
</
admin>

and that solved the problem smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
CT Schubert
Sr. Member
 
Avatar
Total Posts:  197
Joined:  2008-10-08
Southern California
 

Setup a rule in your main .htaccess file?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ButterfliesForRelease
Jr. Member
 
Avatar
Total Posts:  25
Joined:  2008-11-16
Brooker, FL
 

No :( ...

Nothing else forwards unexpectedly to https either. From browsing to checkout it only goes to https when it should.

Edit: Oh, I missunderstood I thought you were asking if it could be something in the .htaccess file. Setting a rewrite rule wouldnt help. The problem isn’t that the links show up wrong… the problem is that even when you enter the link manually it automatically forwards you to the secure url. Rewriting in the .htaccess file would just result in a forward loop.

 
Magento Community Magento Community
Magento Community
Magento Community
 
eliezerisrael
Jr. Member
 
Total Posts:  28
Joined:  2009-06-18
 

I’m curious about the <rewrite> technique that you’re using.

I’d love to use it, but I don’t see it used in the core code or documented anywhere.

Can you fill out the picture a bit?  Where does the rewrite block go?  Is the next tag in the module name?

 
Magento Community Magento Community
Magento Community
Magento Community
 
vnation
Jr. Member
 
Total Posts:  7
Joined:  2012-04-25
 

Wish I had read this post sooner! This stupid https error had been bothering me for months.... Works perfectly when I renamed the value of admin/routers/clnews/args/frontName in config.xml. Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top