Scenario
A Joomla website hosted in Linux server is migrated to Windows. Several compatibility issues will be reported. The rules in .htaccess file will not work in Windows Servers which will cause malfunctioning of the website. Here are the steps on how to deal with these issues.
For this to work in IIS, a web.config file should be created and the corresponding rules in .htaccess should be imported to the same file. Here is a sample web.config file. Copy the entire content.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Security Rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAny">
<add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" ignoreCase="false" />
<add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" ignoreCase="false" />
<add input="{QUERY_STRING}" pattern="(\<|%3C).*script.*(\>|%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="SEO Rule">
<match url="(.*)" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" />
<add input="{URL}" negate="true" pattern="^/index.php" ignoreCase="false" />
<add input="{URL}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
So, the file web.config is ready. Now the rules in .htaccess has to be converted in accordance with IIS. In IIS6, you can make use of the ISAPI_REWRITE module. Go to http://www.isapirewrite.com/ for downloading it.
If you are having IIS7, here are the steps involved in converting those rules.
The x86 version of URL Rewrite module can be downloaded here : http://go.microsoft.com/?linkid=9722533
The x64 version of URL Rewrite module can be downloaded here : http://go.microsoft.com/?linkid=9722532
Install the module, restart the IIS manager. Choose the website in which you have to convert the rules (under Sites category). You will see the ‘URL Rewrite’ module in IIS.
Open it. Since the web.config file is already created with some predefined rules, you will see it as Inbound rules (by the Names – Security Rule and SEO Rule).
You can convert the rules in .htaccess file by accessing the ‘Import Rules’ under Inbound Rules category in the Actions pane.
Choose the .htaccess file and click Import. You will see the rules in ‘Rewrite Rules’ section and the converted rules in ‘Converted Rules’ option. Click Apply on the Actions pane on the right hand side to save these rules to the web.config file (If a web.config file was not created as mentioned earlier, that file will be newly created). Make sure there are no conflicts in the conversion. Watch the Summary on the bottom end. There was a conflict when we did it, its shown here. In such cases, remove any unsupported rules and then click Apply.
Converting PHP to FastCGI
We have do it from Plesk control panel. If you don’t have the administrator access, you may need to contact your Administrator. Others (Gods !) read on
Select the Domain, go to Web Hosting Settings.
Scroll down to Services. Choose PHP support to run as FastCGI application.
Final Steps
Go to Joomla Administrator interface. Access Global Configuration from the main menu. Under SEO Settings, make sure the following are set to Yes
Search Engine Friendly URLs : Yes
Use Apache mod_rewrite : Yes
Done, From now your Joomla website shoule work as smooth as it were in the Linux server. Sit back and Enjoy !
Continue ReadingCustomer wanted to have a dedicated IP, but once I change the IP from the plesk control panel, I couldn’t get the website when accessed using IP. Instead, it was giving me the plesk control panel’s default page. Reason ? Default Website was having the IP as “All Unassigned”. Set that to the main IP address. But after that I was getting a new error.
What I could get was “Bad Request (Invalid Hostname)” in bold letters. Here is what I did to fix the same.
Start -> Run -> inetmgr -> Expand the (+) -> Websites -> Right click on the domain name -> Take Properties -> Website -> IP Address (make sure that it has the dedicated IP assigned there) and then click “Advanced”
Add/Edit Web Site Identification
IP Address : Choose the dedicated IP from drop down list
TCP/IP Port : 80
Host Header Value : Leave it blank (Important)
Leaving the Host Header Value should fix the issue and fetch the website when accessing it using the IP.
Continue ReadingThis is common issue, but solutions varies based on situations. It could be one or a combination of a solutions listed below. If you had to go through another solution to solve it, please add it over here for others.
cd %plesk_bin%
websrvmng –update-anon-password –domain-name=domainname.com
Okay those are my current solutions.
Continue Reading