We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG .htaccess Generator

Development and Programming

Joobs's avatar
Joobs
362 posts
16 years ago
Joobs's avatar Joobs

Is there anything special to do to get this working when EE is in a sub directory?

do I set the htaccess path to the root of my server, or to the sub directory?

Gregm, there seems to be an extra pipe chatacter “|” in the remove index.php rule, this gave me a 500 error too.

       
Eric Barstad's avatar
Eric Barstad
198 posts
16 years ago
Eric Barstad's avatar Eric Barstad

Hi Leevi,

For the home page of a current project, I am using the EE Pages module with “/” set as the page URI. As a result, LG .htaccess generator produces this:

RewriteCond %{REQUEST_URI} ^/(site|includes|products||products|about|purchasing|contact-us|members|P[0-9]{2,8}) [NC]

The blank “||” causes my 404 page to appear when I try to access my system directory. If I delete one of the “|”, the log-in page shows up as usual.

       
dekalog6's avatar
dekalog6
75 posts
16 years ago
dekalog6's avatar dekalog6

Great plug in!

Excuse the simple inquiry but I can’t get it to recognize the .htaccess file. I’ve tried every combination without success. I just use a blank .htaccess page.

“Your .htaccess could not be found or is not writable. Please check the .htaccess file exists and has the correct permissions.”

Any help would be appreciated.

       
Casey Reid's avatar
Casey Reid
82 posts
16 years ago
Casey Reid's avatar Casey Reid

I have a weird issue going on when using this extension. When trying to access a PDF document in the sidebar of the site I’m working on (sidebar is an embed), I get the strange error you’ll see in the attached image. However, if I am accessing a PDF file that is in the main content area (not an embed), the PDF shows up fine. Is there any issues with this working on files contained within an embed? The files have been uploaded using a File custom field.

Edit: It looks like it isn’t an issue with this extension and instead has to do with corrupt PDF’s or something. Sorry to hijack the thread.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
is the generator working with the ee function “write blacklist to htaccess”? no overwriting problems?

I didn’t even know that function exists! I’ll look into it and see what can be done.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
Is there anything special to do to get this working when EE is in a sub directory? do I set the htaccess path to the root of my server, or to the sub directory? Gregm, there seems to be an extra pipe chatacter “|” in the remove index.php rule, this gave me a 500 error too.

You should be able to set the path to the .htaccess in the extension settings.

Regarding the double pipe issue. If you site does not have pages you shoul remove the pipe. I was thinking about adding a {if pages} variable in the next version.

       
ideadigital's avatar
ideadigital
9 posts
16 years ago
ideadigital's avatar ideadigital

I’m experiencing the same issue on my end.

Great plug in! Excuse the simple inquiry but I can’t get it to recognize the .htaccess file. I’ve tried every combination without success. I just use a blank .htaccess page. “Your .htaccess could not be found or is not writable. Please check the .htaccess file exists and has the correct permissions.” Any help would be appreciated.
       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
I’m experiencing the same issue on my end.
Great plug in! Excuse the simple inquiry but I can’t get it to recognize the .htaccess file. I’ve tried every combination without success. I just use a blank .htaccess page. “Your .htaccess could not be found or is not writable. Please check the .htaccess file exists and has the correct permissions.” Any help would be appreciated.

The .htaccess path must be the server path, not a url with a trailing slash. Also it must be the directory.. don’t add .htaccess to the end.

Does that change anything?

       
Poccuo's avatar
Poccuo
22 posts
16 years ago
Poccuo's avatar Poccuo
I’m experiencing the same issue on my end.
Great plug in! Excuse the simple inquiry but I can’t get it to recognize the .htaccess file. I’ve tried every combination without success. I just use a blank .htaccess page. “Your .htaccess could not be found or is not writable. Please check the .htaccess file exists and has the correct permissions.” Any help would be appreciated.
The .htaccess path must be the server path, not a url with a trailing slash. Also it must be the directory.. don’t add .htaccess to the end. Does that change anything?

I’m experiencing the same issue and have checked to be sure the server path is correct. Is there any other possible explanation for the message?

My .htaccess file permission is set at 644. and I have not changed any of the .htaccess Rules in the settings.

EDIT:

Changing the permissions of the file to 666 fixed this. The strange thing is I had to try it 2-3 times before it worked. Is 666 the proper “write permissions” for the .htaccess file? I couldn’t find this info anywhere in the documentation.

       
timkelty's avatar
timkelty
177 posts
16 years ago
timkelty's avatar timkelty

Definitely a bit puzzled….

I’m NOT using the pages module, and I don’t have a masked CP.

With the default htaccess template, things were working fine, but I couldn’t access my CP with adding /index.php. [original htaccess]

I saw others not using the pages module were having the double pipe issue, so I removed the extra pipe, resulting in: [new htaccess]

All seemed fine, I could access my cp again, and wrong pages were directing me to my 404 template. All good right? But then I checked out the headers. When I removed the extra pipe, it was sending me to my 404 template, but the headers were serving up: HTTP/1.x 200 OK

Even weirder, If I add the pipe back in (reverting to the original htaccess) I get HTTP/1.x 404 Not Found, as I should.

Got me….anyone?

       
kriz's avatar
kriz
231 posts
16 years ago
kriz's avatar kriz
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.

Apache error log says:

[Fri Oct 03 19:26:07 2008] [alert] [client 127.0.0.1] C:/www/livethenews/.htaccess: Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/eesystem/index.php?S=a4cf65ab84780fc34eb122f2232f622f24a28957&C=templates

Err how frustrating. Thought this plugin would work out of the box!!

Anyways I went back to .htaccess and commented the following:

# Remove IE image toolbar
<FilesMatch "\.(html|htm|php)$">
  #Header set imagetoolbar "no"
</FilesMatch>

Which seems to load the page now. But im guessing this is just a temp solution! Any way to fix this?

       
kriz's avatar
kriz
231 posts
16 years ago
kriz's avatar kriz

My .htaccess file looks like:

# -- LG .htaccess Generator Start --

# .htaccess generated by LG .htaccess Generator v1.0.0
# http://leevigraham.com/cms-customisation/expressionengine/addon/lg-htaccess-generator/

# secure .htaccess file
<Files .htaccess>
 order allow,deny
 deny from all
</Files>

# Dont list files in index pages
IndexIgnore *

# EE 404 page for missing pages
ErrorDocument 404 /index.php?/live_the_news/404

# Simple 404 for missing files
<FilesMatch "(\.jpe?g|gif|png|bmp)$">
  ErrorDocument 404 "File Not Found"
</FilesMatch>

RewriteEngine On

RewriteBase /

# remove the www
RewriteCond %{HTTP_HOST} ^(www\.$) [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Add a trailing slash to paths without an extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule ^(.*)$ $1/ [L,R=301]

# Remove index.php
# Uses the "include method"
# http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/(site|search|live_the_news|live_the_news_embeds|gallery|members|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index.php?/$1 [L]

# Remove IE image toolbar
<FilesMatch "\.(html|htm|php)$">
  Header set imagetoolbar "no"
</FilesMatch>

# -- LG .htaccess Generator End --

Any help appreciated

       
kriz's avatar
kriz
231 posts
16 years ago
kriz's avatar kriz
Gregm, there seems to be an extra pipe chatacter “|” in the remove index.php rule, this gave me a 500 error too.

On a side note. I just verified it. It does add an extra “|”. Can the author also fix this please. Removing the extra | still gives the 500 error page

       
kriz's avatar
kriz
231 posts
16 years ago
kriz's avatar kriz

Any idea how to get this to work?

       
timkelty's avatar
timkelty
177 posts
16 years ago
timkelty's avatar timkelty
Definitely a bit puzzled…. I’m NOT using the pages module, and I don’t have a masked CP. With the default htaccess template, things were working fine, but I couldn’t access my CP with adding /index.php. [original htaccess] I saw others not using the pages module were having the double pipe issue, so I removed the extra pipe, resulting in: [new htaccess] All seemed fine, I could access my cp again, and wrong pages were directing me to my 404 template. All good right? But then I checked out the headers. When I removed the extra pipe, it was sending me to my 404 template, but the headers were serving up: HTTP/1.x 200 OK Even weirder, If I add the pipe back in (reverting to the original htaccess) I get HTTP/1.x 404 Not Found, as I should. Got me….anyone?

Nobody’s else has noticed this? I’ve had to abandon the include method for the exclude until I figure this out.

       
First 3 4 5 6 7 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.