Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

HI! I have IIS6 on win 2003 server with one website at www.example-one.com. I have enabled IIRF and everything works very well (also thanks to http://serverfault.com/questions/13176/drupal-clean-url-on-iis)

On the same server I also have a website at www.example-two.com/mysite. but I cannot enable cleanURLs on this one. If I add the rewrite rules suggested for sub-folders (same link as above), cleanURLS work on this site, but stop working on the other. I guess only the last line is executed.

I am not a real sysadmin (I have been assigned to mantain this server because nobody else would), can anyone help me to write the proper rewrite rules for IIRF in order to enable cleanURLs on both sites?

Thanks a lot in advance.

share|improve this question
    
You should add your solution as an answer below. Then you should accept it after the waiting period for self-answers has expired. –  Dennis Williamson Dec 15 '09 at 16:03
    
fixed. sorry for my noobiness thank you –  user29185 Dec 16 '09 at 8:33
add comment

1 Answer

up vote 1 down vote accepted

With a bit of additional research, I learned that the 'L' flag "tells IIRF to process no more patterns if the current one matches". Therefore my solution was to modify iirf.ini from the above thread as follows:

# Do not pass to drupal if the file or directory exists
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Handle query strings on the end
# firstly for the subfolder without the L flag
RewriteRule /mysubfolder/(.*)\?(.*)$ /mysubfolder/index.php\?q=$1&$2 [I]
# then for the root
RewriteRule /(.*)\?(.*)$ /index.php\?q=$1&$2 [I,L]

# now pass through to the generic handler
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# firstly for the subfolder without the L flag
RewriteRule ^/mysubfolder/(.*)$ /mysubfolder/index.php?q=$1 [I]
# then for the root
RewriteRule ^/(.*)$ /index.php?q=$1 [I,L]

HTH.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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