Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

rewrites for Windows IIS #73

Closed
frissony opened this Issue · 9 comments

4 participants

@frissony

I find that the page rendered in the browser is using URLs like <link rel="stylesheet" href="/css/blueprint/screen.css">.

If I use the complete path to the css file, things work.

Seems like a bug in roots theme since the WordPress default Twenty Ten theme works just fine (though it does not use relative URIs like roots is using).

What is the fix for this problem?

@retlehs
Owner

just renamed the title of this issue to reflect the full problem (it's not just the css). the problem is that the rewrites we do in https://github.com/retlehs/roots/blob/master/inc/roots-cleanup.php generate .htaccess rules and not rules for web.config

once someone figures out the rules i'll add them onto the wiki (like how we did with rewrites for nginx, see https://github.com/retlehs/roots/wiki/Nginx)

@frissony

I tried a lot playing around with IIS rewrites - IIS does no rewriting at all. Logs are always showing 404.

I guess roots is unusable for me until this gets sorted out.

Thanks anyway.

@frissony frissony closed this
@frissony frissony reopened this
@retlehs
Owner

IIS does do rewriting.. how do you think permalinks work for wordpress? it's just a matter of creating them. you don't have to use the rewrites to use roots, just comment out the appropriate lines in the cleanup file

http://www.iis.net/download/urlrewrite
http://learn.iis.net/page.aspx/470/importing-apache-modrewrite-rules/

@frissony

I meant that I made rewrite rules to rewrite /css/style.css to /wp-content/themes/roots/css/style.css and that IIS was seeming to do nothing about that rewrite - it was ignoring that rewrite rule (I checked the option to log the rewrite rule, and that did not log the rule to the log file; I did also test the rule using the test dialog in IIS - that's working fine).

Not sure what I need to do so that IIS is able to serve (for example) style.css - right now the IIS log shows 404 for requests to that file (among others).

What I tried:

Create a rewrite rule:

Pattern: ^/css/(.*)$
Action type: Rewrite
Rewrite URL: /wp-content/themes/roots/css/{R:1}
Log rewritten rule is checked

@draivika

Hi I managed to get the rewrite rules to work after installing this http://www.helicontech.com/download-isapi_rewrite3.htm in IIS, based on this post http://www.kylecaulfield.com/permalink-for-wordpress-iis-6-mod_rewrite-fixed-free
hope that helps.

Was there another solution?

@retlehs
Owner

haven't heard anything - could you please add an IIS page to the wiki with instructions on how you got it to work?

@retlehs
Owner

i just read over the article you linked, after installing ISAPI_Rewrite 3 are you able to just use the same exact .htaccess rules on IIS?

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^css/(.*) /wp-content/themes/roots/css/$1 [QSA,L]
RewriteRule ^js/(.*) /wp-content/themes/roots/js/$1 [QSA,L]
RewriteRule ^img/(.*) /wp-content/themes/roots/img/$1 [QSA,L]
RewriteRule ^plugins/(.*) /wp-content/plugins/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

or does it need to be further modified?

@retlehs
Owner

http://www.iis.net/download/URLRewrite should handle this. will add a reference to it in the wiki with #264

@retlehs retlehs closed this
@hereswhatidid

I've created a gist that has the rewrite rules working within the IIS web.config:

https://gist.github.com/hereswhatidid/6066415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.