5 Website Development Tips To Boost Your Business Growth Exponentially

Joomla in IIS Sub-folder web.config rewrite  (godaddy.com Servers)

 

I have spent the worst 48 hours of my life trying to make a simple solution work with a clients go-daddy Windows hosting solution

Godaddy doesn’t allow editing root directory file permissions so Joomla should be installed in a sub folder.  and permissions on that sub folder can be given write access.  You can go in and reset the other permissions separately if needed.

 

 

Now you would need a redirect and rewrite in web.config  so ill paste it below..  

This has worked for me:   (but of course keep in mind that linux servers are always better for joomla)

 WEB.CONFIG

( you should be able to copy n paste / change folder “root”  to your folder,  and change Domain “www.gulftires.com” to your domain

 

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>

# Redirect all domain.com to www.domin.com

<rule name="Redirect to www subdomain">

<match url=".*" />

<conditions logicalGrouping="MatchAny">
 <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" negate="true" />
 </conditions>

<action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" redirectType="Permanent"/>          

</rule>

# Add Joomla rewrite scripts                        

  <rule name="Joomla! Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAny">
<add input="{QUERY_STRING}" pattern="base64_encode[^(]*\([^)]*\)" ignoreCase="false" />
<add input="{QUERY_STRING}" pattern="(&gt;|%3C)([^s]*s)+cript.*(&lt;|%3E)" />
<add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
<add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
</conditions>
<action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden"

statusDescription="Forbidden" />
</rule>          

<rule name="Joomla! Rule 2">
<match url="(.*)" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="^/index.php" ignoreCase="true" negate="true" />
<add input="{URL}" pattern="/component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$" />
<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>

#  This Scripts bypasses the rewriting for administrator page ( makes life simpler)

<rule name="check is admin page" stopProcessing="true">
<match url="^root/administrator" ignoreCase="true" />
<action type="None" />
</rule>

#  Redirects if someone happens to directly go to this sub folder

<rule name="Redirect if root" stopProcessing="true">
<match url="root/(.*)$" />
<action type="Redirect" url="{R:1}" />
</rule>

#  This is the rewrite engine here,   this will make domain read to the /root folder
<rule name="Rewrite to sub folder">
<match url="^.*$" />
 <conditions>
<add input="{HTTP_HOST}" pattern="^(www\.)gulftires\.com$" />
</conditions>
<action type="Rewrite" url="root/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration >


Published on: Mar 03, 2021

Categories: Web Development

    No Comments yet! Be the first one to write.


    Leave a Reply

    Your email address will not be published. Required fields are marked *