With the final release of Drupal 4.7 there seems to be some new code added (was not present in any RC) which tries to test for Clean URL compatibility which causes some issues when using ISAPI Rewrite on IIS with Drupal. The ISAPI rules I use work fine with Drupal once I bypass this test, the problem is that the method used to test for clean URL's is dependent on .htaccess.
Problem No.1
This new code present on lines 291~300 (inclusive) in system.module tests for clean URL's, but this code is what generates the test URL;
'<a href ="'. str_replace('?q=', '', url('admin/settings', '', 'clean_url')) .'">'. t('Run Clean URL Test') .'</a>'
Problem with this code is that ISAPI Rewrite does not have the ability to check for file existance like .htaccess does. This means that when using the .htaccess the index.php portion of the string is removed, but not when using ISAPI rewrite. The results of which means you'll get a URI stem like this when using IIS with ISAPI Rewrite;
/drupal/index.phpadmin/settings&
And this when using Apache with the Drupal .htaccess rules;
/drupal/admin/settings&
Obviously the IIS one is not going to work.
Problem No.2
The fact that Drupal tests specfically for a .htaccess based rule isn't so much a problem, as it has always been this way. The difference is that you used to be able to execute this SQL directly against your Drupal database using PHPMyAdmin (or similar) to effectively bypass that test;
SELECT * FROM variable v WHERE v.name = 'clean_url';
UPDATE variable SET value = 's:1:"1";' WHERE name = 'clean_url';
However, now you are unable to enable Clean URL's in Drupal even if you manually set it to be enabled directly in the database as system.module now overides that setting if the Clean URL test fails (which it always will with ISAPI Rewrite on IIS).
Solution
I'll try and take a closer look in the next few days to write a specific rule for ISAPI Rewrite for this new test, but currently the only solution for those using Clean URL's with IIS and ISAPI Rewrite is to manually remove/comment out lines 291~300 (inclusive) in system.module (or download attached modified version) which effectively removes Clean URL testing. This will revert the Clean URL setting to the same way it was in all the RC versions, so be sure that your ISAPI Rewrite rules are setup or your site will be cactus.
To make things more straight forward for us IIS users, would it please be possible to place this Clean URL test in an if
statement that checks the _SERVER["SERVER_SOFTWARE"]
PHP variable for the existance of Apache before being executed? That way the test still works for Apache users, but us IIS users don't have to go digging through code and stripping out bits just to get Clean URL's to work.
Comment | File | Size | Author |
---|---|---|---|
system.module | 57.38 KB | brashquido |
Comments
Comment #1
chx CreditAttribution: chx commentedSorry for the last minute change. As a quickfix put
$conf['clean_url'] = 1
to the end of your settings.php.Comment #2
brashquido CreditAttribution: brashquido commentedHi Károly,
I tried putting
$conf['clean_url'] = 1
at the very end of my settings.php file, but it resulted in getting a blank page. I'll do a search around and see what I can find.Comment #3
sepeck CreditAttribution: sepeck commentedI am using clean URL's on IIS with with this line
$conf['clean_url'] = 1; // 1 enables, 0 clears clean_url
on my IIS site. Now I broke my ISAPI_Rewrite settings so paging doesn't work but I think that's my fault.
www.blkmtn.org
Comment #4
brashquido CreditAttribution: brashquido commentedSorry, my mistake;
$conf['clean_url'] = 1
is a lot different to$conf['clean_url'] = 1<strong>;</strong>
.Cheers
Comment #5
magico CreditAttribution: magico commentedClean URL test has a few problems in certain conditions that can only be surpased by admin knowledge and setting a settings.php variable.
In this case, is a "by design" problem.
Comment #6
MikeOConnor CreditAttribution: MikeOConnor commentedI got the whole clean_URLs shebang working a couple minutes ago; Drupal 5, IIS v6. Here's the cookbook;
- Step 1 -- get ISAPI_Rewrite going (i'm using the paid version so i can set the rules in the root directory of the virtual web site rather than for the whole machine)
- Step 2 -- put an httpd.ini file for ISAP_Rewrite in the root directory of the site, include the following rules in the file;
# Accept a url with the following extensions and pass them through unchanged.
RewriteRule (.*.gif|.*.png|.*.jpg|.*.pdf|.*.js|.*.css) $1 [I,L]
# Make URLs sane
RewriteRule /index.php.* $0 [I,L]
RewriteRule /(.*)\?(.*) /index.php\?q=$1&$2 [I,L]
RewriteRule /(.*) /index.php\?q=$1 [I,L]
- Step 3 -- add the following line to the settings.php file for the site (I put it at the end)
$conf['clean_url'] = 1;
- Step 4 -- modify the database to toggle on the clean-url variable in the VARIABLE table (note; this is one of the "I'm not sure I really needed to do this" steps). I did this with the MySQL Control Center. Double-clicked the VARIABLE table to open it, scrolled to the bottom of the table, selected "insert record" from the Query menu and then;
set the "name" field to --->>> clean_url
set it's value to --->>> s:1:"1";
- Step 5 -- modify the system.module file to spoof it into *NOT* testing to see if if clean_urls will work (that's what this thread is all about). Since the shift to Drupal 5 munged up the line numbers for me, the way I did it was to set the default value of the "test to see if clean_urls will work" variable to "everything's ok" instead of "nope, it's not" which then made the program skip the test. Do a search in the file to find the old code;
'#default_value' => variable_get('clean_url', 0),
Replace it with;
'#default_value' => variable_get('clean_url', 1),
Note the "0" changing to "1" at the end, that's what spoofs the test.
Step 6 -- start refreshing a few pages on your site, or travelling to new ones, and see how it's going. I fooled myself by going to cached pages a few times. So go to a page you haven't been to, or refresh the page. Clean URLs abound, I hope. They do for me. I'm a happy camper.
I'm not sure you absolutely have to do everything I did -- but that gaggle of steps is what made it work for me. Clearly, this isn't for the faint of heart so I wouldn't do this unless you're pretty confident. The nice thing is that all of these steps are reversable. :-)
Comment #7
rubensans CreditAttribution: rubensans commentedThanks you MikeOConnor for your contribution !!!
I have been testing a lot and you only need to do:
1.- Put in HELICON ISAPI REWRITE this:
# Accept a url with the following extensions and pass them through unchanged.
RewriteRule (.*.gif|.*.png|.*.jpg|.*.pdf|.*.js|.*.css) $1 [I,L]
# Make URLs sane
RewriteRule /index.php.* $0 [I,L]
RewriteRule /(.*)\?(.*) /index.php\?q=$1&$2 [I,L]
RewriteRule /(.*) /index.php\?q=$1 [I,L]
2.- Add the following line to the settings.php file for the site (I put it at the end)
$conf['clean_url'] = 1;
Best Regards.
Comment #8
hass CreditAttribution: hass commentedSomeone able to update the wrong / incomplete Handbook under http://drupal.org/node/46429 please?
Comment #9
RobRoy CreditAttribution: RobRoy commentedFixed that handbook page. Look okay?
Comment #10
hass CreditAttribution: hass commentedthank you for the handbook update... Asside this ISAPI rules are buggy
i got page not found errors since i use them:
http://localhost/drupal/index.php?q=cron.php
Comment #11
hass CreditAttribution: hass commentedother URLs maybe broken, too.
update.php
xmlrpc.php
Comment #12
brashquido CreditAttribution: brashquido commentedHi All,
I wrote an article on my website about this;
http://www.iis-aid.com/articles/how_to_guides/using_drupal_clean_urls_wi...
About the the only thing these ISAPI Rewrite rules don't do is enable the clean url radio button. Still working on that.
Comment #13
RobRoy CreditAttribution: RobRoy commentedIf we get some feedback saying that those rewrite rules work, I'll incorporate them into the handbook page. I don't have IIS to test, so I'm just going off public feedback.
Comment #14
hass CreditAttribution: hass commented@brashquido: Your variant isn't working at all. Aside if you document something that should be cut and paste then please use PRE.
Error: Bad regular expression at lines 4 - 4.
Comment #15
brashquido CreditAttribution: brashquido commentedThanks for the catch on the formatting issue Hass. Those rules are working for me though, they are a direct copy & paste from my production server. Not sure why you are getting a Bad regular expression error, I'll take a look at it.
Comment #16
hass CreditAttribution: hass commented@brashquido: the bug seems the pipe after uploads.
ISAPI Rewrite config if Drupal is installed in a subdirectory (Solution requires ISAPI_Rewrite >=2.9 Build 63)
ISAPI Rewrite config if Drupal is installed in Webservers Root
Comment #17
brashquido CreditAttribution: brashquido commented*slapshead* Of course it is. I didn't get any time really to look at it yesterday, but after copying and pasting my rules into my article I removed an entry for the AWStats "js" directory after uploads. I obviously neglected to remove associate pipe symbol.
While we are at it the second last rule should be removed or deactivated. This was an attempt to get fully Clean URL's when using the paging module (sample_article/page1 instead of sample_article/?page=0,1) but I never got around to finishing it as I read that using the paging module can lead to search engine penalization as they see the pages as duplicate data. Thanks for the help there Hass, I think the rules should be pretty clean now. The only thing I haven't been able to resolve or had a lot of time to look into is the "Clean URL Test" in the Drupal admin.
Comment #18
RobRoy CreditAttribution: RobRoy commentedIf we get confirmation on an exact ruleset, I'll put it in that handbook page. @hass can you confirm that works? Anyone else on IIS?
Comment #19
hass CreditAttribution: hass commentedyes, the last and the two versions i posted are working, but as brashquido said the
RewriteRule /(.*?)(?:/page_(\d+))? /index.php\?q=$1?2&page=$2: [I,L]
should be removed from my versions. please document the "drupal in subdirectory" version as well. maybe without the "suxxx" comment :-).Comment #20
seakayjay CreditAttribution: seakayjay commentedI'm using IIS too. The rules provided work for me as well. But has anyone test this with banner.module as well? I've tried adding two rules identical to cron.php for the two banner files which are placed on the root.
but at the log message, it stated that the banner_db.php is not found.
Comment #21
hass CreditAttribution: hass commentedThe bad side of the Helicon ISAPI_Rewrite is, this config needs to be extended by every filename that is located in the webroot... maybe you have a problem with the
CacheClockRate 3600
that isn't available in the lite version if i remember correctly. i tried your rule in the regex tester and it works. i don't know why it shouldn't work.Aside, why are this banner files located in the webroot? i thought this is only a core file location... shouldn't this files in the modules/banner directory? i never used / tryed this banner module...
Comment #22
hass CreditAttribution: hass commentedthe rules need to be extended for Drupal 5:
if not, Drupal 5 install isn't working... now we should really happen all bugs in this rules finally fixed... :-(
Comment #23
brashquido CreditAttribution: brashquido commentedYep, that should about cover it.
Comment #24
RobRoy CreditAttribution: RobRoy commentedCan you post the entire ruleset in a comment so I can make sure to copy and paste it into the page? Then, I'll delete the comments.
Comment #25
hass CreditAttribution: hass commentedHere it is RobRoy...
ISAPI Rewrite config if Drupal is installed in Webservers Root
ISAPI Rewrite config if Drupal is installed in a subdirectory (Solution requires ISAPI_Rewrite >=2.9 Build 63)
...sometimes i wish to have a permission to correct/change outdated or wrong books :-).
Comment #26
FiReaNGeL CreditAttribution: FiReaNGeL commentedCan you confirm that these settings work with imagecache? I'm currently experiencing problems using IIS and your settings; imagecache doesnt seem to do anything (not creating thumbnails, etc). Imagecache is highly dependant on url rewrite and is a critical module for most sites (its the only viable image handling solution right now).
Comment #27
brashquido CreditAttribution: brashquido commentedNever actually used it, but I'll give it a try.
Comment #28
OpusDei-1 CreditAttribution: OpusDei-1 commentedThe ISAPI rules work great... until I try to go to my docuwiki or phpmyadmin. Having a heckuva time rewriting the rules to allow for that. Any ideas? The docuwiki and phpmyadmin folders are in the root of the webserver, as it is drupal is returning page not found.
Comment #29
brashquido CreditAttribution: brashquido commentedIf you are using the free version of ISAPI Rewrite, then you only have one httpd.ini file which applies to all your websites. In this file you'll need to set some rules so that these rules only apply to the domains you want them to. You can find it in the guide I wrote here;
http://www.iis-aid.com/articles/how_to_guides/using_drupal_clean_urls_wi...
Comment #30
localhost@2006.planet-soc.com CreditAttribution: localhost@2006.planet-soc.com commentedHave you ever looked at the Ionics Isapi Rewrite Filter (IIRF)?
It has a new version that has just been released under a new license in February 2007 under the: Microsoft Permissive License (MS-PL). It supports PCRE directly within the configuration file and, from the looks of it, all the main rewriting settings specified in the comments above will also work with it. In fact, changes to the configuration file take place immediately after it is saved. For an example of functionality, I copied the first line from the .htaccess file and whenever a user requests to view a file such as block.module I have it redirect to the home page using the following code (as I couldn't determine an easy way to deny access, I don't believe this is exploitable, but feel free to prove me wrong):
Comment #31
redamo CreditAttribution: redamo commentedI second using Ionics Isapi Rewrite Filter. It's free, it has source code available and doesn't have the limitations of the Lite Helicon filter described above. I share the rules that I made, feel free to modify them or use them.
RewriteLog E:\temp\iirfLog.out
RewriteLogLevel 3
RewriteFilterPriority HIGH
# Accept a url with the following directories and pass them through unchanged.
RewriteRule ^/misc/(.*)$ /misc/$1 [I,L]
RewriteRule ^/files/(.*)$ /files/$1 [I,L]
RewriteRule ^/modules/(.*)$ /modules/$1 [I,L]
RewriteRule ^/themes/(.*)$ /themes/$1 [I,L]
RewriteRule ^/sites/(.*)$ /sites/$1 [I,L]
RewriteRule ^/uploads/(.*)$ /uploads/$1 [I,L]
RewriteRule ^/css/(.*)$ /css/$1 [I,L]
RewriteRule ^/images/(.*)$ /images/$1 [I,L]
# for modules that provide their own js (tinymce,img assist etc)
RewriteRule ^(.*\.js)$ $1 [I,L]
RewriteRule ^(.*\.gif)$ $1 [I,L]
RewriteRule ^(.*\.png)$ $1 [I,L]
RewriteRule ^/modules/tinymce/(.*)$ /modules/tinymce/$1 [I,L]
# Make URLs sane
RewriteRule ^/cron\.php$ /cron.php [I,L]
RewriteRule ^/index\.php\?q\=(.*)$ /index.php?q=$1 [I,L]
RewriteRule ^/update\.php\?op\=(.*)$ /update.php?op=$1 [I,L]
RewriteRule ^/update\.php /update.php [I,L]
RewriteRule ^/xmlrpc\.php /xmlrpc.php [I,L]
RewriteRule ^/robots\.txt /robots.txt [I,L]
# Handle query strings on the end
RewriteRule /(.*)\?(.*)$ /index.php\?q=$1&$2 [I,L]
# now pass through to the generic handler
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ /index.php?q=$1 [I,L]
Cheers!
Comment #32
robray CreditAttribution: robray commentedHey all,
this is Rob Ray (robray not robroy who is also in this thread. heh...)
Also, if you are using Urchin to track on your site and you have the __utm.js and __utm.gif files stored in drupals root you'll need to add a rule for __utm.js and __utm.gif.
I was banging my head on this for a while.
Comment #33
blur CreditAttribution: blur commentedCheck out IIS Mod-Rewrite. It makes Drupal clean permalinks work on IIS exactly the way they work on Apache (it uses the same .htaccess rules). Here is a very useful link with detailed info on how to set it up: Clean Permalinks for IIS using .htaccess
IMO, it's BY FAR the best solution for IIS. Note it's commercial though.
Comment #34
hass CreditAttribution: hass commentedAre you working for this company? The best and most popular is ISAPI_Rewrite as i know.
Comment #35
blur CreditAttribution: blur commentedHass, apparently you haven't used IIS Mod-Rewrite, and apparently you haven't noticed that ISAPI_Rewrite is trying to copy IIS Mod-Rewrite... You need a little update, check out ISAPI_Rewrite v3 beta...
Comment #36
hass CreditAttribution: hass commentedWe are using ISAPI_Rewrite and if you search the net, you will get 90% Helicon results and some other bad ones, less development, buggy, beta, not working, no support or expensive and bad. I know about v3.0 and this will be very helpful, but i don't think they have copied the idea from IIS Mod-Rewrite. It's more that customers request this Apache functionality on a move to IIS.
"IIS Mod-Rewrite" have copied this from Apache...
However, someone able to remove this backlink SPAM comments, please? They are OT here.
Comment #37
blur CreditAttribution: blur commentedOk, this is getting ridiculous and really OT, but it's my time to ask you, are you working for ISAPI_Rewrite?
Take a look at these two links that I saw in a forum. I hope you will finally understand who is copying who. Literally copying...
http://www.micronovae.com/ModRewrite/ref/Compatibility.html
http://www.helicontech.com/isapi_rewrite/doc/compatibility.htm
FYI, I've been using ISAPI_Rewrite for years, but now I'm switching my clients to IIS Mod-Rewrite simply because it's a lot better and saves me a great deal of time. It's up to you if you want to waste your time using ISAPI_Rewrite and waiting for a horrible beta to become a stable product...
Just one question, have you EVER tried IIS Mod-Rewrite?
Comment #38
ellasisking CreditAttribution: ellasisking commentedI am using the rules described in post #31 by redamo (with IIRF), however I have my drupal installation in a sub directory.
so, going to www.mysite.com redirects to www.mysite.com/drupal1
using the rules in #31 only work for drupal isntallations running in the root directory. How do I modify to run in subdirectory drupal1?
Comment #39
hass CreditAttribution: hass commentedsee #25
Comment #40
ellasisking CreditAttribution: ellasisking commented#25 is for the Helicon solutions isn't it? Would the exact same reg expressions work with the Ionic solution.....if so I cna't get it to work, i get file not found errors when navigating to these links?
Comment #41
hass CreditAttribution: hass commentedThis thread is only about Helicons ISAPI_Rewrite.
Comment #42
hass CreditAttribution: hass commentedHelicon have released ISAPI_Rewrite version 3.x for a long time that works out of the box with drupals .htaccess. It was a little bit buggy in the last versions (.38 to .42), but v3.1.43 seems to be ok.
Additional CleanURL check is done in a different way in D6+. So no need to keep this open for the next year...
Comment #43
hass CreditAttribution: hass commentedHelicon have released ISAPI_Rewrite version 3.x for a long time that works out of the box with drupals .htaccess. It was a little bit buggy in the last versions (.38 to .42), but v3.1.43 seems to be ok.
Additional CleanURL check is done in a different way in D6+. So no need to keep this open for the next year...
Comment #44
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #45
jcbrew CreditAttribution: jcbrew commentedHaas,
It's not working out of the box for me. I just bought ISAPI 3 and installed it today - I can not get my drupal sites to enable clean urls.
Do I need to make any changes to the .htaccess file or settings.php? I'm a bit confused
Comment #46
jcbrew CreditAttribution: jcbrew commentedComment #47
hass CreditAttribution: hass commentedNo, nothing needs to be changed - really nothing. It simply works like Apache mod rewrite with D6. In D5 only you need to add the extra line
$conf['clean_url'] = 1;
to settings.php.I'm running many sites on IIS with ISAPI 3. Only make sure you are using the latest version... there were many bugs in past, but this have all been fixed... I told Helicon ~10 releases it is not working with Drupal as expected and they have fixed all issues I came across in 3.1.0.43. If I remember correctly version from 3.1.0.32 to 3.1.0.42 are not working as expected with Drupal. I know for sure 3.1.0.43 is working well and I'm also running 3.1.0.53. I haven't tested the light version with subdirectories...
Maybe you have a permission issue.
Comment #48
jcbrew CreditAttribution: jcbrew commentedThank you for the reply. I added the code you gave me to setting.php. After I saved and started navigating the site I kept getting 403 error. I know it's because ISAPI 3 is not set up correct.
I contacted my hosting company that installed ISAPI3 for me and asked them to verify that it was running / configured properly. This was their reply:
I made sure the current Drupal .htaccess file had the proper permissions and it still didn't work.
Can someone tell me how to create a simple page that will reference a simple .htaccess file? This way I can verify that the ISAPI3 installation was not done properly.
I guess the best thing to do would be uninstall ISAPI3 and reinstall myself. But I don't want to do that until I verify that it doesn't work with the simple page setup.
Thanks for any help...
Comment #49
jcbrew CreditAttribution: jcbrew commentedI installed ISAPI Rewrite Version 3 (The full version) onto my server. I wasn't able to get Drupal to recognize it so I did a little test. I created a new directory and created two files and entered
DirectoryIndex newmain.html
into the .htaccess file then I browsed to the directory where the .htaccess file resides expecting to be taken to newmain.html but was instead taken to index.html (old default page). So I suppose this tells me the ISAPI Rewrite is not working.
I have also made sure the permissions were set to both the directory and the .htaccess file. I got to the point were I gave EVERYONE full access to the directory and .htaccess file.
So, assuming it's not working. Can someone help me figure what I need to do to get this working. I bought the full version in hopes that I wouldn't have to worry about all this stuff.
My server is a Windows machine with Windows 2003 Web Edition IIS6. I am running both Drupal 6 and 5. ISAPI is not working with either version.
Please let me know if there any more info needed.
Comment #50
jcbrew CreditAttribution: jcbrew commentedComment #51
hass CreditAttribution: hass commentedTurn on debugging in ISAPI3 and then look into the logs. Maybe you find something. Otherwise Helicon Support and the Helicon Forum are very helpful. Your issue is not Drupal related.
This is off topic here.
Comment #52
hass CreditAttribution: hass commentedComment #53
jcbrew CreditAttribution: jcbrew commentedThanks for throwing my issue to the side. I can't get anyone to help. Helicon Support is of no help they want to blame the hosting company and the hosting company wants to blame "Drupal" and the people at Drupal don't care.
Comment #54
hass CreditAttribution: hass commentedI assure you - this must be a server issue! ISAPI 3 should be ~100% Apache compatible and it works FOR SURE with Drupal out of the box. We don't need to care about anything here. The Drupal .htaccess is working with Apache. If there is something broken (nevertheless it was in past) it is a Helicon issue - not Drupal. I worked out many bugs with Helicon and they fixed all bugs. There is no bug i'm aware about - as it runs fine on 3 boxes (XPSP2, 2 x Win2K3 both 32bit) I've installed it.
Make sure "NETWORK SERVICE" have at minimum change access to the .htaccess files (RTFM). And as already said - TURN ON debugging mode in ISAPI. It could show you many things - maybe this could help - if not Helicon can tell you with this logs. I'm pretty sure the source of your issues is the hosting company or their buggy config if you don't have the hands on it... you cannot do anything wrong and you don't need to change any .htaccess as ISAPI3 (only version 3) provides Apache compatibility what means you DON'T need to change anything. This Apache compatibility should be *the* case WHY you are using version 3.
PS: This is a closed documentation case.
Comment #55
interestingaftermath CreditAttribution: interestingaftermath commentedI have installed ISAPI_Rewrite 3 FULL and have copied the following into the Helicon Manager into my site's config tab (which is my site's root .htaccess file)
I have then added the
$conf['clean_url'] = 1
to my settings.php file.What next? Should Clean URLs work? Each link I click it tries to take me to a clean URL page but I get Page Not Found. Any help would be appreciated. I cannot continue working on this site until this is fixed because the client does not want it to launch without clean urls. I miss apache. :(
Comment #56
hass CreditAttribution: hass commentedNo, don't do this. The rules are ONLY for ISAPI_Rewrite 2.x - NOT 3.x! You don't need to add anything by hand for 3.x as this version is 100% compatible with Apache and use the standard .htaccess files Drupal provides out of the box.
Comment #57
interestingaftermath CreditAttribution: interestingaftermath commentedOk, so I have undone all the settings that I added (settings.php and the .htaccess with ISAPI). What now? I try to enable clean urls through Drupal and it does not work.
I have ISAPI_Rewrite 3 installed on the server. What's next?
Sorry to be a pain.
Comment #58
hass CreditAttribution: hass commentedISAPI_Rewrite 3.x:
D5 - Add
$conf['clean_url'] = 1
to your settings.php - that's all you need to do.D6 - do nothing extra - it simply works.
Us the latest version of ISAPI 3.x first :-). If this all does not help - enable
LogLevel
(http://www.helicontech.com/isapi_rewrite/doc/LogLevel.htm) setting and try to figure out what's wrong with ISAPI.Comment #59
interestingaftermath CreditAttribution: interestingaftermath commentedI added
$conf['clean_url'] = 1
to my settings.php file but no luck. I guess that would have been too easy.I added
LogLevel debug
to the .htaccess file via Helicon Config Editor but the log doesn't seem to read anything different. Am I doing something wrong?Comment #60
interestingaftermath CreditAttribution: interestingaftermath commentedAfter reading the Help info, I figured out where to put the LogLevel line.
It's saying it has insufficient access to the install directory of ISAPI_Rewrite and to the root directory of my site. I went through the permissions section in the Help file and it seems to all check out.
Comment #61
interestingaftermath CreditAttribution: interestingaftermath commentedSorry for the multiple posts but in reading, it seems like I need to give access to IIS_WPG but that group does not show up in my security tab. Any suggestions?
Comment #62
interestingaftermath CreditAttribution: interestingaftermath commentedLast post of the evening:
I have figured out how to add IIS_WPG and then added the necessary permissions. My error.log is now blank and receives NO errors whatsoever. However, my links are still broken on my site. Any ideas?
I have added the conf string to settings.php and clean urls page shows ENABLED. When I click on a link, it tries to take me to the clean url page but the page is not found.
Thanks for everything.
Comment #63
interestingaftermath CreditAttribution: interestingaftermath commentedGOT IT! For some reason when I moved my site the .htaccess file was not transferred. For anyone else having this same issue, here's where I found my answer:
http://www.helicontech.com/articles/drupal.htm
Comment #64
hass CreditAttribution: hass commentedI would say they have written this page after I informed them about ~10-15 releases that Drupal .htaccess is not working with ISAPI_Rewrite :-).
3.1.0.56 was the first that worked as it should. I know for sure you don't need to change the .htaccess file in Drupal's root as I'm also running this config and it works out of the box. But if IIS_WPG and NETWORK SERVICE don't have access to the .htaccess file you need to grant them permission - at least "change" on all dirs - otherwise this will never work.
Keep always in mind - Helicon say they provide nearly 100% Apache .htaccess compatibility and 100% of what Drupal use. As this is the case the standard file MUST work without any changes... if not - ISAPI_Rewrite have a bug - nevertheless they may try to tell you something different first... :-)
Comment #65
interestingaftermath CreditAttribution: interestingaftermath commentedhaas, you have been very helpful. Thank you! I have ONE last question, promise...
I am still using the trial of the FULL version. I am running a dedicated server where I host about 4 other sites that are NOT Drupal. I do not want to harm those sites whatsoever so I went with the FULL version. Is this necessary or could I get the LITE version and still do clean urls just for my one site? I know there is only 1 http.conf but because of version 3.x you clearly don't need to add anything to that file.
What do you think? Can I save my client $100 and still use this awesome software?
Comment #66
hass CreditAttribution: hass commentedSorry, but I haven't tested with 3.x light version, but having all rules in one file (in the programs helicon directory) is proven to be non-administrable and time wasting and error prone and so on. You can disable ISAPI_Rewrite FULL by default for all sites and enable it only for specific sites... It's not the default setting, but we have also done this in past to not "harm" some sites. :-)
Give them the few bucks... their support is really good and bugs will be fixed very soon.
Comment #67
volkiz CreditAttribution: volkiz commentedrule imagecache folder before files folder like this:
RewriteRule ^/files/imagecache/(.*)$ /index.php\?q=/files/imagecache/$1 [I,L]
RewriteRule ^/files/(.*)$ /files/$1 [I,L]
Comment #68
bohz CreditAttribution: bohz commentedI know this is an old post, but the rules posted by redamo still do work fine on IIS6 (thanks).
however, they do not work for sites installed in subdirectories.
I tried the rules posted in #25, but they do not work for IIRF.
Can anyone help me finding the correct rules for rewriting URLs in a subdirectory with IIRF on IIS6?
thanks a lot!
Comment #69
hass CreditAttribution: hass commentedWith ISAPI 3.0 there is NO NEED to use the above rules. v3.0 use the standard Drupal .htaccess.
Comment #70
bohz CreditAttribution: bohz commentedthank you.
but I am using Ionic Isapi Rewrite, not the Helicon filter.
However, i may switch to it; does the standard drupal .htaccess work with the lite 3.0 version?
thanks
Comment #71
nejine CreditAttribution: nejine commentedbohz, can you give us some tip on how to use Ionic Isapi Rewrite for Drupal on IIS? It will shed us some light. Thank you.
Comment #72
bohz CreditAttribution: bohz commentedHI!
Actually I am trying to understand that myself!
Anyway, I just followed the installation instructions and used the drupal ini file that is provided with the filter which, by the way, is exactly the one posted by redamo in #31.
Beside that, there's nothing special that I did to have IIRF working on IIS6.0 (Win server 2003).
Please note: at this time, I still cannot have IIRF working in subdirs, and there's another caveat: I have to disable the filter when running update.php (see http://drupal.org/node/348336).
I guess that, if ISAPI rewrite 3.0 LITE does work with subdirs, I will switch to it as soon as I can.
Hope this helps.
cheers
Comment #73
bohz CreditAttribution: bohz commentedFor completeness, and hoping it may help others, I have solved both problems thanks to this post on ServerFault.
To solve the problem with update.php, I simply replaced redamo's ini file with the one provided in the link above (not 100% sure that ALL the rules posted by redamo should be removed)
To have IIRF working in subdir AND in root folders I modified the rules as follows
(that is adding the rewriterule for the subfolder before the ones for the root without the 'L= Last test if match' flag):
So far, it seems to work well.
Cheers
Comment #74
lias CreditAttribution: lias commentedYes, that worked for me to using Ionics Isapi Rewrite Filter on Win2003 server, IIS 6 & PHP 5.3 with Drupal 7.15. What I had been missing was the Iirf.ini file copied to the website root directory.
Thanks to mparker17's post at http://serverfault.com/questions/13176/drupal-clean-url-on-iis
IirfGlobal.ini:
Iirf.ini: