Chunk

M16 Search Engine Friendly Joomal 1 6 Article: Difference between revisions

From Joomla! Documentation

Jzlcdh (talk | contribs)
Jzlcdh (talk | contribs)
Line 13: Line 13:


2) Click on Site --> Global Configuration menu to configure SEO Settings:  
2) Click on Site --> Global Configuration menu to configure SEO Settings:  
"Search Engine Friendly URLs" to "Yes"
"Search Engine Friendly URLs" to "Yes" and
"Use Apache Mod Rewrite" to "Yes"
"Use Apache Mod Rewrite" to "Yes"
(screenshot to be added here)
(screenshot to be added here)

Revision as of 09:16, 14 February 2011

IIS

(Note: this IIS documentation may not apply to Joomla versions prior to 1.6: so please use the alternative documents which are available if you are not on Joomla 1.6 or above)

The IIS URL Rewrite module stores rules in a site's web.config file, expressed in XML format. You can create the file yourself or use the GUI in the IIS Manager.

Apache .htaccess rules can be converted to the web.config format. You can import .htaccess rules using the GUI/wizard. For more information on converting .htaccess to web.config see http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/

How set up IIS URL Rewriting

1) Make sure you are running on a version of IIS supported by your version of Joomla e.g. for Joomla 1.6 at least IIS7

2) Click on Site --> Global Configuration menu to configure SEO Settings: "Search Engine Friendly URLs" to "Yes" and "Use Apache Mod Rewrite" to "Yes" (screenshot to be added here)

3) In IIS Manager check whether URL Rewrite is already installed (screenshot to be added here)

4) If it is not then from http://www.iis.net/download/URLRewrite either

 a) Use the Microsoft Web Platform Installer to install IIS7 Recommended Configuration

or

 b) Download URL Rewrite from the "x86" (if your Windows is 32 bit) or "x64" links and install.

5) Either

 a) Use the IIS "URL Rewrite" pictured above to create your rules (regular expressions, wildcards or exact matches are all supported) e.g.

Pattern field: ^([^/]+)/?$ Ignore case ON Action type: Rewrite Rewrite URL: index.php/

or

 b) If it does not already exist; create and open a web.config file located in the C:\inetpub\wwwroot\joomla directory. Copy in the following code:   
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="Common Exploit Blocking" stopProcessing="true">
                    <match url="^(.*)$" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" />
                        <add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" />
                        <add input="{QUERY_STRING}" pattern="(\&lt;|%3C).*script.*(\>|%3E)" />
                        <add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" />
                        <add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" />
                    </conditions>
                    <action type="Redirect" url="index.php" appendQueryString="false" redirectType="SeeOther" />
                </rule>
                <rule name="Joomla Search Rule" stopProcessing="true">
                    <match url="(.*)" ignoreCase="true" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{URL}" pattern="^/search.php" ignoreCase="true" />
                    </conditions>
                    <action type="Rewrite" url="/index.php?option=com_content&amp;view=article&amp;id=4" />
                </rule>
                <rule name="Joomla Main Rewrite Rule" stopProcessing="true">
                    <match url="(.*)" ignoreCase="true" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        <add input="{URL}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" />
                    </conditions>
                    <action type="Rewrite" url="index.php/" />
                </rule>
            </rules>
        </rewrite>
        <caching>
            <profiles>
                <add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" />
            </profiles>
        </caching>
    </system.webServer>
</configuration>