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

Tim Print's avatar
Tim Print
104 posts
16 years ago
Tim Print's avatar Tim Print

Sorry to bump but can anybody give any advice with above.

I’m running out of things to try.

Apache version 1.3.41 (Unix) PHP version 5.2.5 MySQL version 4.1.22-standard-log

       
Austin Siewert's avatar
Austin Siewert
129 posts
16 years ago
Austin Siewert's avatar Austin Siewert

How do you force the WWW, instead of removing the www?

remove the www

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

       
jcowen's avatar
jcowen
66 posts
16 years ago
jcowen's avatar jcowen

I’m having a minor problem with this that I haven’t been able to see covered in earlier posts.

I’ve installed .htaccess Generator at my site is running OK without index.php. However if I go to www.mysite.co.uk/template - the url is being rewritten to www.mysite.co.uk//template - it displays fine, but kinda low.

If I go to an article page: www.mysite.co.uk/template/article - the url is absolutely fine.

All pages are totally accessible without index.php so it’s not a big problem but would be nice to get it fixed if anyone can suggest anything?

Thanks

       
jcowen's avatar
jcowen
66 posts
16 years ago
jcowen's avatar jcowen

OK, never mind I’ve figured it out!

Great tool.

       
monteconsulting's avatar
monteconsulting
35 posts
16 years ago
monteconsulting's avatar monteconsulting

I have been getting 500 errors too. I commented out this line:

# Dont list files in index pages
# IndexIgnore *

And it seems to be working. I’m not a .htaccess guru, so I don’t know if that’s a bad thing to comment out or what it actually means. Is there a reason that specific rule would be causing 500 errors? Hopefully things will work with it commented out…

Edit: Does it stop a listing of files if you visit a directory on the site? (Like web ftp-viewer thing?) If that’s the case then I’m not sure why that specific line would have been causing problems…

Edit #2: A friend told me “if mod_autoindex isn’t in use then it would be an undefined directive” Not sure exactly what that means either, but there ya have it. =) Or maybe it’s this thing: and mod_autoindex has to be set by my host (EngineHosting). Either way, seems like I should be in the clear.

       
monteconsulting's avatar
monteconsulting
35 posts
16 years ago
monteconsulting's avatar monteconsulting

I also can’t get the problem figured out with the embedded stylesheets. It would be nice to figure out how to, but for now I’ll just place the style sheets as files on the server and link that way, ‘cause that works.

       
Paul B's avatar
Paul B
241 posts
16 years ago
Paul B's avatar Paul B

Wondering if anyone can shed some light on an issue I can’t resolve …

I’ve installed lg.htaccess on an MSM installation with two sites. I didn’t have any issues removing index.php from site 1. But, no matter what I have tried, I can’t get index.php removed from the second site.

Is there a trick to getting this extension to work with MSM? What details can I provide?

Thanks, P

Update: Got it. Had to manually update path.php (removed index.php from $site_index = “”; )
       
Boyink!'s avatar
Boyink!
5,011 posts
16 years ago
Boyink!'s avatar Boyink!
I have been getting 500 errors too. I commented out this line:
# Dont list files in index pages
# IndexIgnore *

Just FYI - I’m experimenting with this tool on a EngineHosting EE site and also found that I had to comment out this code or I got Server 500 errors.

       
Michael Spielman's avatar
Michael Spielman
42 posts
16 years ago
Michael Spielman's avatar Michael Spielman

I’ve successfully removed “index.php” from my URLs, but I can’t seem to get rid of the “?”. I’ve gone from this: www.site.com/index.php?/title to this: www.site.com/?/title.

If I turn off “Force URL query strings”, the question mark goes away, but I’m left with an extra slash in the URLs (ie www.site.com//title) and they don’t work.

Here’s my .htaccess file. Any ideas?

RewriteEngine on
# -- LG .htaccess Generator Start --

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

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

# 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|tutorial|gallery|pregnant|blog|abortion|end_abortion|greensboro|abortion_facts|event_schedule|citing_abort73_as_a_source|2009_operating_budget|about_us|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 --
       
Angus K's avatar
Angus K
14 posts
16 years ago
Angus K's avatar Angus K

I’m also getting 500 errors I’m afraid but can’t see a double pipe. Any help appreciated!

# -- 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?/pages/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|_embeds|staging|dmwiki|sandpit|feeds|_globals|pages|schools|invalid_url|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 --
       
Sean O'Brien's avatar
Sean O'Brien
78 posts
16 years ago
Sean O'Brien's avatar Sean O'Brien

I’ve deleted my initial request for help. I’m still not sure what the problem was, but it seems to have been fixed.

After being unable to find the problem causing my .htaccess failure, I put the index.php back in place and delete the contents of the .htaccess file. After waiting a few days, I used the extension to regenerate the .htaccess content, removed the index.php, and everything works flawlessly again with no index.php. I had repeated these same steps days earlier to no effect, but perhaps I missed something the first few times.

Anyway, thanks for this extension Leevi.

       
neongray's avatar
neongray
13 posts
16 years ago
neongray's avatar neongray

Hi Leevi,

Great extension. Im still having a bit of a problem that the documentation hasn’t explained. When I make links using EE code, lets say for example a permalink, It still adds the index.php/ to the link. The site works entirely well without the index.php, its just that all my generated links still have it in it.

For example:

<a href="http://{title_permalink={my_weblog}/index}">{title}</a>{/if}

returns www.domain.net/index.php/my_weblog/ (if it helps, im on MediaTemple)

Thanks in advance!

       
Ben Parizek's avatar
Ben Parizek
128 posts
16 years ago
Ben Parizek's avatar Ben Parizek

This is a great plugin. It has worked fine for me for quite some time however recently I have begun to get a few errors. They appear above the design in the Control Panel in two different expression engine installs that I work on. When I refresh the page or go on to a different section of the cp, they no longer appear.

On one website I get this error:

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /www/enginehostingaccount/public_html/system/extensions/ext.lg_addon_updater_ext.php on line 701

And, of course, on the other website it is not happening right now as I write this post… I will follow up if it happens again, it has been fairly regular for some time now. Always seems to be around line 700… (if I remember correctly)

Are these errors anything I should be concerned about? Did I cause them in some way I can easily undo?

       
davidrtk's avatar
davidrtk
26 posts
16 years ago
davidrtk's avatar davidrtk

I am struggling in getting something to work with the LG .htaccess extension. I have a dowloads area on my site but after I install this extension it doesnt allow me to access the files in the download area. The downloads folder resides in the root of the site. Anybody has a suggestion on how to fix this? If I try to get a file from the downloads area y displays the home page.

Thanks,

       
Ben Parizek's avatar
Ben Parizek
128 posts
16 years ago
Ben Parizek's avatar Ben Parizek

Here are the errors from my other account (re: two posts above):

Notice: Use of undefined constant CURLOPT_AUTOREFERER - assumed 'CURLOPT_AUTOREFERER' in /www/location/public_html/system/extensions/ext.lg_addon_updater_ext.php on line 704

Notice: Use of undefined constant CURLOPT_AUTOREFERER - assumed 'CURLOPT_AUTOREFERER' in /www/location/public_html/system/extensions/ext.lg_addon_updater_ext.php on line 704

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /www/location/public_html/system/extensions/ext.lg_addon_updater_ext.php:704) in /www/location/public_html/system/extensions/ext.lg_htaccess_generator_ext.php on line 672

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /www/location/public_html/system/extensions/ext.lg_addon_updater_ext.php:704) in /www/location/public_html/system/extensions/ext.lg_htaccess_generator_ext.php on line 672
       
First 7 8 9 10 11 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.