« Previous Next »

Thread: URL Rewrite and Magento

Last post 03-17-2009 1:32 PM by ruslany. 9 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (10 items)

Sort Posts:

  • 10-06-2008, 7:29 AM

    URL Rewrite and Magento

    Has anyone tried using the URL Rewrite Module with Magento. I currently have Magento working with IIS7 and the Helicon ISAPI_Rewrite Lite but have not been able to make the URL Rewrite Module work.

  • 10-06-2008, 1:13 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 664

    Re: URL Rewrite and Magento

    Could you add more details on what does not work? Also could you share the ISAPI_Rewrite rules that work?

    http://ruslany.net
  • 10-06-2008, 2:44 PM In reply to

    Re: URL Rewrite and Magento

    Here are the rules that Magento uses and have been working with Helicon

     Options +FollowSymLinks
        RewriteEngine on
        RewriteBase /magento/
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-l
        RewriteRule .* index.php [L]

  • 10-06-2008, 2:44 PM In reply to

    Re: URL Rewrite and Magento

    Here are the rules that Magento uses and have been working with Helicon

     Options +FollowSymLinks
        RewriteEngine on
        RewriteBase /magento/
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-l
        RewriteRule .* index.php [L]

     
  • 10-06-2008, 3:41 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 664

    Re: URL Rewrite and Magento

    The only thing that looks suspicios here is the rule that sets the environment variable. URL rewriter does not support this. Does Magento rely on this environment variable?

    There is also a RewriteCond that uses "-l" flag, which is not supported by URL rewriter, but I do not think this will affect anything, so this condition can be removed.

    http://ruslany.net
  • 10-06-2008, 7:19 PM In reply to

    Re: URL Rewrite and Magento

    I believe I could remove the rule that sets the environment variable; I've seen setups where this was commented out.

    The other issue which I'm not sure about relates to the fact that Magento runs only with PHP set to ISAPI mode. Is it true that the URL Rewrite Module runs only with CGI apps?

  • 10-06-2008, 7:52 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 664

    Re: URL Rewrite and Magento

    URL rewrite module runs with any kind of applications. But using of FastCGI module with URL rewriter ensures that the REQUEST_URI server variable will be set to contain the original URL before it was rewritten. This server variable used by many PHP apps to figure out the original URL, and from the rewrite rules used by Magento, it looks like this app also may be using REQUEST_URI.

    You can try to check if this server variable is set when running PHP via ISAPI and if it is set then what value it contains when using URL rewriter - original or rewritten URL?

    http://ruslany.net
  • 03-16-2009, 8:59 AM In reply to

    Re: URL Rewrite and Magento

    Hi,
    I am realy not getting further searching google and iis.net I still can not find any hints on how to translate this :

    Options +FollowSymLinks
        RewriteEngine on
        RewriteBase /magento/
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-l
        RewriteRule .* index.php [L]

    Into a valid code for the URL rewriter from microsoft.

    It starts with the RewriteBase as unkonw command?
    continous with the HTTP:Authorization, that he does not know the parameter E and so on.
    Is there any help her for this issue, I would love to donate or buy a couple of beers for a solution :O)

     Andreas

  • 03-16-2009, 9:17 AM In reply to

    Re: URL Rewrite and Magento

    Options +FollowSymLinks
        RewriteEngine on
        #RewriteBase /magento/
        #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        #RewriteCond %{REQUEST_FILENAME} !-l
        RewriteRule .* index.php [L]

     This is what I have now, because -l is not supported, but why is the RewriteBase command not supported?, Does anybody have an Idea for me?

  • 03-17-2009, 1:32 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 664

    Re: URL Rewrite and Magento

    This translatest to: 

        <rule name="Imported Rule 1" stopProcessing="true">
          <match url=".*" ignoreCase="false" />
          <conditions>
            <add input="{URL}" pattern="^/(media|skin|js)/" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>

    By placing the web.config with this rewrite rule into the /magento directory you will get the same behavior as you would get with mod_rewrite RewriteBase directive.

    http://ruslany.net
Page 1 of 1 (10 items)
Microsoft Communities