Trying to get htaccess file to ignore a root folder |
[eluser]Philipp Gérard[/eluser]
Both methods work. The reason why they don't work in your environment is up to speculation. What Apache version, what modules etc. do you use on what OS that might be conflicting?
[eluser]hugle[/eluser]
[quote author="The Questioner" date="1291076097"]Sorry Hugle & Vitico, I've tried both your methods and neither of them correctly force CI to ignore any processing for the "secure" folder.[/quote] Those methods both should work. tested myself. What are your folder structure? and is your CI in the root folder?
[eluser]The Questioner[/eluser]
I humbly offer my apologies. It's obviously something that I must be doing wrong. This is the file structure: Code: public_html Where ".htaccess" is the main htaccess file, "system" is the main CI folder and "secure" is a password protected folder (the one that I'm interested in). The folder "secure" contains its own htaccess file which governs the folder's security: Code: AuthName "Secure" This folder contains just one file, "barclaycard_posturl_process.php". What I have just noticed is that if I do this to the main htaccess file: Code: Options +FollowSymLinks Then CI does indeed ignore processing the "secure" folder and the site follows normal behaviour for a password protected folder. However, the rest of the site URLs stop working (404 errors) unless I manually add the "index.php" into the appropriate place in the URL. So www.mywebsite.com/shop/brand/10, doesn't work but www.mywebsite.com/index.php/shop/brand/10 does work.
[eluser]hugle[/eluser]
Hello so if the page shows up only with index.php in the url, it means you have mod_rewrite problems. which means mod_rewrite is disabled... or something like that ![]()
[eluser]The Questioner[/eluser]
If I re-introduce this line into the bottom of the htaccess file: Code: RewriteRule ^(.*)$ /index.php/$1 [L] Then any URLs without the "index.php" are successfully redirected to the correct CI controller. Therefore mod_rewrite must be working. However, the inclusion of this line then stops the "secure" folder from being ignored by CI.
[eluser]The Questioner[/eluser]
I'm wondering, is it just a matter of telling the htaccess file to ignore adding the "index.php" into the URL only if the URL is pointing to the "secure" folder. If this condition is true, then htaccess can immediately stop processing any further commands? Should this stop CI from processing the URL? Can anyone advice me on this approach?
[eluser]Unknown[/eluser]
I'm also having the exact issue on an EE build 1.6.7. I have a .zip of my portfolio in the root of the public site and that .htaccess line to remove "index.php" is messing things up. Hope someone can help us.
[eluser]The Questioner[/eluser]
I've finally got this sorted out – I've had to pay a htaccess specialist to get it working. I would like to share his solution with the rest of the CI community. The main htaccess file now looks like this Code: #check the mod_rewrite module is enabled or not He also changed the htaccess file within the "secure" folder (which previously just held the AuthUserFile details): Code: #Put the rewrite engine off for this subdirectory |
Welcome Guest, Not a member yet? Register Sign In |