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

Tom83's avatar
Tom83
12 posts
16 years ago
Tom83's avatar Tom83

Sorry, only just seen this thread.

Just posted this http://ellislab.com/forums/viewthread/98382/

Need to remove the question mark from the css url.

Thanks.

       
PositionOne's avatar
PositionOne
57 posts
16 years ago
PositionOne's avatar PositionOne

Thanks, but mine isn’t a coded URL. It’s generated by EE automatically in response to a signup (BTW the htaccess code you’ve posted in that thread is exactly the same code as I have above).

I don’t want to start tweaking EE system files, but I’m pretty sure it should be possible to match a URL where part of the URL = “?ACT” and create a new rule to remove the “?”.

If anyone knows how to do that I’d be grateful for the post.

Thanks in advance.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg
I don’t want to start tweaking EE system files, but I’m pretty sure it should be possible to match a URL where part of the URL = “?ACT” and create a new rule to remove the “?”.

Granted that I don’t have time to fully help you with this now, but you may want to start with adding code similar to:

RewriteCond %{QUERY_STRING} ^$

You should be able to add that as a condition on the rewrite rules that are messing up the mailing list signup, so the rule doesn’t process when the ?ACT exists.

       
Dragan Simonovic's avatar
Dragan Simonovic
71 posts
16 years ago
Dragan Simonovic's avatar Dragan Simonovic

I can’t make this extension to work, Internal Server Error appears. This is from the apache error log:

[Sat Dec 06 11:46:00 2008] [error] [client ::1] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary., referer: http://localhost/v3/index.php/our-services/

And this is generated .htaccess file:

# -- 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?/

# 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} ^/(404|home|our-company|success-stories|our-services|styles|includes||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 how to solve this and make it work?

       
turbineseaplane's avatar
turbineseaplane
16 posts
16 years ago
turbineseaplane's avatar turbineseaplane

Is anyone else having this screw with your pagination?

It’s so random. From my main page I click on “page 2” in the pagination links and it just loads the homepage (i.e. 404’s to the homepage)…but it will successfully load the 3rd, 4th or beyond pages.

I’m new to this.

Any thoughts?

http://hautesheet.com

Thanks.

       
turbineseaplane's avatar
turbineseaplane
16 posts
16 years ago
turbineseaplane's avatar turbineseaplane

Nevermind. Got it working.

       
james Brown's avatar
james Brown
492 posts
16 years ago
james Brown's avatar james Brown

I too am being plagued with 500 internal server errors with the extension. I am sure that mod_rewrite is enabled. For the time being I have gone back to the generic version, which does work for me:

RewriteEngine On
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
       
lance72's avatar
lance72
110 posts
16 years ago
lance72's avatar lance72

Hi Guys,

OK I have read through this thread and external links and am still no better off.

  1. Installed LG.htaccess plugin

  2. Run the script successfully

  3. Removed index.php on Name of your site’s index page: CP Home › Admin › System Preferences › General Configuration

  4. Updated and removed the index.php from the weblogs in the: CP Home › Admin › Section Administration › Section Management › Edit Section Preferences

Others had 5 steps… not me! Am I missing something? Site no work without index.php

cheers Lance

       
AllanW's avatar
AllanW
37 posts
16 years ago
AllanW's avatar AllanW

I’m in the middle of installing it, I ran into problems, too. An earlier issue I ran into was the IE Toolbar section - commenting that out (as the other poster reported) worked for me.

       
Jonathan Schofield's avatar
Jonathan Schofield
175 posts
16 years ago
Jonathan Schofield's avatar Jonathan Schofield

I’ve been experiencing the same problem as cherryred and have solved it for now with a hack, but I’d much rather sort it out with the appropriate htaccess rule. Trouble is I’m not up-to-speed with regular expressions and RewriteCond!

slapshotw kindly suggested adding:

RewriteCond %{QUERY_STRING} ^$

I’ve tried this and whilst it removes index.php nicely from the query string URL sent with member activation emails, that doesn’t seem to help, because clicking on the link doesn’t activate the member! It seems that EE 1.6.6 requires the presence of index.php in the activation URL for it to function.

So I guess what’s needed is to exclude query strings from the rewrite. Anyone know how to modify Leevi’s code to do that, please?

       
Jonathan Schofield's avatar
Jonathan Schofield
175 posts
16 years ago
Jonathan Schofield's avatar Jonathan Schofield

Another issue (apologies if this has already been covered)…

LG .htaccess Generator comes with this segment:

# 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]

I get why this is there and I’d like to keep it in, but the trouble is it messes with any links to in-page IDs. For example:

http://example.com/templategroup/url_title/#idattribute

…gets rewritten to:

http://example.com/templategroup/url_title/#idattribute/

…which then doesn’t work as an in-page link!

Anyone figure how to modify the rewrite so that any URLs ending in #foo don’t get appended with a trailing slash?

       
AllanW's avatar
AllanW
37 posts
16 years ago
AllanW's avatar AllanW

I noticed that the rewrite rules omitted “members” but not “member” (singular), which is what it should be (at least in my setup). Adding “member” to the rewrite rules fixed my member login problem.

       
Jonathan Schofield's avatar
Jonathan Schofield
175 posts
16 years ago
Jonathan Schofield's avatar Jonathan Schofield

wazungu, the LG extension keeps track of your:

  1. Template Group names

  2. The Profile Triggering Word you set in Site > Admin > Members and Groups > Membership Preferences

  3. The Category URL Indicator you set in Site > Admin > Weblog Administration > Global Weblog Preferences

If you change any of these you must subsequently resubmit your .htaccess file from Site > Admin > Utilities > Extensions Manager > LG .htaccess Generator. In your case, had you set your Profile Triggering Word to Members after submitting your htaccess? I ask only because I made the same mistake!

       
Jonathan Schofield's avatar
Jonathan Schofield
175 posts
16 years ago
Jonathan Schofield's avatar Jonathan Schofield

Scratch the /#foo/ problem. I had a basic error in my {path} value that was causing the problem! :red:

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

I’ve just done a new install of EE tonight. 1.6.7 - Build: 20090122.

I installed LG .htaccess generator straight away but when I hit “submit and regenerate” I get:

Not Acceptable An appropriate representation of the requested resource /mysystemfoldername/index.php could not be found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache/1.3.41 Server at ihg.org.uk Port 80

Any idea what might be causing this. The site is running OK. Pure default install at the moment. The extension isn’t writing anything to my .htaccess file though.

I’ve never removed the index.php before but have a client who has asked for it specifically.

       
First 6 7 8 9 10 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.