2

Does anyone have experience doing this on a windows server, running IIS7?

I've got access to the IIS manager, and the URL Rewrite module, but how to setup the rewrite rules, and how should the patterns look?

Ive tried this example, but the auto-generated examples of public url's are no good

http://www.iis.net/learn/extensions/url-rewrite-module/user-friendly-url-rule-template

When inputting:

www.domain.com/index.php/url-title

i only get this option for public url:

www.domain.com/index

No good :)

So i need to make a blank rule, but have no clue how to create the pattern.

4

Try

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 <system.webServer>
 <rewrite>
    <rules>
      <rule name="Rewriter" stopProcessing="true">
        <match url="^(.*)$" ignoreCase="false" />
        <conditions>
          <add input="{R:1}" pattern="^(index\\.php|images|css|js|favicon\\.ico)" 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/{R:1}" appendQueryString="true" />
      </rule>
    </rules>
  </rewrite>
 </system.webServer>
</configuration> 

if you were using an older IIS version with the ISAPI rewrite module then you could do

 RewriteEngine on 
    RewriteCond $1 !^(css|js|swf|images|system|tools|themes|index\.php) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]

where the RewriteCond piped lines are equal to the folders that you don't want to be rewritten.

Certainly this worked on an older IIS version (I now try to avoid IIS where possible).

| improve this answer | |
  • realised that the above was when we had ISAPI Rewrite installed via IIS. With newer IIS7 you should have a web.config file. Update the post above – Steven Grant Jan 18 '13 at 20:20
  • Hi Steven. Sorry for the delay on this one. I got this solution working! Thanks a lot. – Michael Rasmussen Feb 15 '13 at 9:56
  • Thank you very much. I have researched many documents. And you save me. Thank you again. – user3886 Dec 17 '14 at 3:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.