Windows server

If you are running the script on IIS on windows based hosting then you may encounter URL re-writing error 
to avoide any windows re-writing errors please create file on your root folder with name ( web.config )
and paste the below provided code into newly created file : 


<?xml version="1.0" encoding="UTF-8"?>
      <remove name="CGI-exe" />
      <add name="CGI-exe" path="*.exe" verb="*" modules="CgiModule" scriptProcessor="C:\php\php-cgi.exe" resourceType="File" requireAccess="Execute" allowPathInfo="true" />
        <rule name="block favicon" stopProcessing="true">
          <match url="favicon\.ico" />
          <action type="CustomResponse" statusCode="404" subStatusCode="1"
            statusReason="The requested file favicon.ico was not found"
            statusDescription="The requested file favicon.ico was not found" />
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
            <add input="{HTTP_HOST}" pattern="^example\.com$" />
          <action type="Redirect" redirectType="Permanent" url="{R:1}" />
        <rule name="Imported Rule 2" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
          <action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />