Canonical ReWrite Problems (301 Redirect) With Coppermine Canonical ReWrite Problems (301 Redirect) With Coppermine
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Canonical ReWrite Problems (301 Redirect) With Coppermine

Started by Enterfrize, April 08, 2012, 02:58:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Enterfrize

Hello everyone,

I'm struggling with getting my URL Rewrite working with Coppermine.  Here are the specs:

Coppermine 1.5.18 (Latest)
Windows 2008 R2 IIS 7 Dedicated Server
Joomla 2.5.X

I am using URL Rewriter 2.0 (as far as I can tell).

The Canonical rewrite feature should do everything I need by default.  Everything looks ok, but Coppermine URLs get renamed strangely and become unusable.  I'm trying to get it to go from mtbs3d.com to www.mtbs3d.com automatically.

This is what happens.  The original URL:

http://www.mtbs3d.com/gallery/albums/farcry2review/normal_FarCry2_%230017.jpg

gets rewritten to:

http://www.mtbs3d.com/gallery/albums/farcry2review/normal_FarCry2_#0017.

So some important info is getting stripped.  Any way around this problem?

Regards,
Enterfrize

Αndré

Your gallery seems to work as expected for me, but it seems that the rewrite rule is currently not enabled. Maybe this document will help you: http://documentation.coppermine-gallery.net/en/bridging.htm#integrating_subdomain_www

Enterfrize

Hi Andre,

I don't think the document applies to IIS very well.  However, here is my web config file:

<configuration>
    <system.webServer>
        <security>
            <requestFiltering allowDoubleEscaping="false" />
        </security>
      <httpRedirect enabled="false" destination="http://www.mtbs3d.com$S$Q" exactDestination="false" childOnly="false" httpResponseStatus="Permanent" />
        <rewrite>
            <rules>
                <rule name="CanonicalHostNameRule1" enabled="false">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="^www\.mtbs3d\.com$" negate="true" />
                    </conditions>
                    <action type="Redirect" url="http://www.mtbs3d.com/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

The reason the gallery worked for you us I haven't kept the rule active very long because I don't want to hamper the website use.

Regards,
Enterfrize

Αndré

I never used IIS, so I don't know if your config file is correct. What happens when the rule is active and you visit your website without the leading "www" subdomain? In Apache you'll be redirected immediately to the defined domain. From this point the rule doesn't affect anything in Apache. Maybe somebody with IIS experience will see that thread and can give you some advise or at least share his/her experience.