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

Leevi Graham's avatar
Leevi Graham
1,143 posts
about 16 years ago
Leevi Graham's avatar Leevi Graham

There is no update planned as yet. This extension is essentially free which means all client work is deemed more important. If I get a second I’ll look at the update, alternatively the project is on GitHub which means there is an opportunity for anyone to make the changes and send me a pull request.

       
Brian M.'s avatar
Brian M.
529 posts
about 16 years ago
Brian M.'s avatar Brian M.

Just looking at GitHub baffles the crap outta me 😉

I’m surprised more people aren’t using both Structure and this. Actually I’m surprised you aren’t!

       
conv's avatar
conv
26 posts
about 16 years ago
conv's avatar conv

After the following code:

# 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 $1 ^({ee:template_groups}|{ee:pages}members|P[0-9]{2,8}) [NC] 
RewriteRule ^(.*)$ /index.php/$1 [L]

I have added the following line: Redirect 301 http://www.mydomain/newsroom/newsroom.asp http://www.mydomain/newsroom

Because we have moved away from asp and onto expression engine I need to set up the redirects. Is there a special way I need to add these redirects? Any help appreciated.

Thank you

       
cwpollock's avatar
cwpollock
72 posts
15 years ago
cwpollock's avatar cwpollock

Love this extension,

I’m struggling with a particular redirect issue and was wondering if someone on this thread can help. I’m using two systems, EE and Magento, I want all the EE pages to be “unsecure” except for a few directories.

Here’s what I’ve come up with so far, but I can’t seem to get it working:

# remove the ssl
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/ajax(/.*)?$ [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Basically I’m trying to redirect all the https request to http EXCEPT for the ajax directory. Any one got any clues as to what I’m missing.

Thanks!

       
daithi's avatar
daithi
38 posts
15 years ago
daithi's avatar daithi

I couldn’t find this in the thread, but perhaps there is a quick and easy answer — how to create exceptions that this htaccess generator will ignore? I have non-ee folders that I would like to have behave as they are at present —thanks!

       
Thorvalt's avatar
Thorvalt
23 posts
15 years ago
Thorvalt's avatar Thorvalt

@Jeff and @Brain

Delete the pipe | between {ee:template_groups} and {ee:pages} in the second to last RewriteCond. Then it should be working fine.

       
spacewalk's avatar
spacewalk
106 posts
15 years ago
spacewalk's avatar spacewalk
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?
You should be able to set the path to the .htaccess in the extension settings.

How to use LG .htaccess Generator when EE is installed in a subdirectory rather than the Web root.

I can’t guarantee that this will work for everyone, but it’s working in a client’s account on hosting.com (their choice not mine). Make 2 changes in the stock rewrite rules that come with the extension:

1) Add YOUR subdirectory’s name to RewriteBase:

RewriteBase /subdirectory/

2) In the last line of the section that begins “# Remove index.php”, delete the forward slash BEFORE “index.php” so that it looks like this:

RewriteRule ^(.*)$ index.php?/$1 [L]

In addition to these things, you do of course have to give LG .htaccess Generator the proper path to your .htaccess file (in the Extension’s settings) and, as always, you need to go into EE’s Admin > System Preferences > General Configuration and remove “index.php” from the field labeled “Name of your site’s index page” – in other words, empty that field.

UPDATE I spoke a bit too soon here. I was testing this by manually typing URLs into the browser that did not contain “index.php” and all was well. However, I still had “index.php” in Admin > System Preferences > General Configuration. When I removed it, my pages no longer found the CSS files that I’m maintaining inside EE as templates. Various people have posted .htaccess fixes for this, but none are working for me. I suspect that I may end up moving my CSS files into server directories and linking to them directly, as you pretty much have to do with Javascript in EE anyway. But for now, you should expect this CSS problem if you try what I recommended above.

Anybody else with a solution for CSS maintained as EE templates?

       
globalfit's avatar
globalfit
11 posts
15 years ago
globalfit's avatar globalfit

Loving this extension but just have one problem - my 404 page is displaying when it should but the status returned by EE is 200, not 404. Is there a workaround for this?

       
dealSoft's avatar
dealSoft
7 posts
15 years ago
dealSoft's avatar dealSoft

Hi I already solved rewriting on windows, but on Apache i can’t :(

I also had trouble with double “|” so i removed it manually and it works. Everything else is as it script generate.

But when i try to open link without index.php I’m always presented with Home page?!

In error log I’m getting error like:

File does not exist: /home/domain/public_html/ask/

Well if there is no file/directory why I’m not redirected to 404? Also, should there be “!-d”, because it checks only for files, not directory?!

Please and thanks

       
Briggs's avatar
Briggs
111 posts
15 years ago
Briggs's avatar Briggs

I always get stuck on the simplest of things.

I have an empty .htaccess file stored in /var/www/html/mysite/public_html/ and when I try to submit, i get “Your .htaccess directory does not exist.”

Confused.

       
Chuck Norton's avatar
Chuck Norton
106 posts
15 years ago
Chuck Norton's avatar Chuck Norton
I’m surprised more people aren’t using both Structure and this. Actually I’m surprised you aren’t!

I also use structure for most of my projects.

Levi, I think people would be willing to pay for this, although maybe not a lot - but if it would make it worth your time to make it work - I say charge for it. You’re time is valuable and I sure as heck have no idea how to make this work.

Just saying

😉

       
Chuck Norton's avatar
Chuck Norton
106 posts
15 years ago
Chuck Norton's avatar Chuck Norton

Also - I just thought of this - could it be I’m having problems because of MAMP?

I have localhost:8888/ee-starter/ as my root url. I’ve got the urls to work correctly, but when clicking the links to those urls - it just shows a 404 error page.

Has anyone else gotten it to work in mamp?

       
horizonvp's avatar
horizonvp
107 posts
15 years ago
horizonvp's avatar horizonvp

I’m also having the issue with the CSS not working regardless of what I do. Any suggestions would be appreciated.

       
knipoog's avatar
knipoog
3 posts
15 years ago
knipoog's avatar knipoog

I installed the htaccess Generator in combination with the Pages Module. It seems to work fine, accept the following. When I link to a page in my website or type an existing URL (for instance www.schatkaart-geboortekaartjes.nl/aanbieding) an extra “/” is put between .nl en aanbieding (www.schatkaart-geboortekaartjes.nl//aanbieding).
When I disable the htaccess Generator this problem doesn’t exist anymore.

What can I do to solve this?

Thank you for your reaction,

Mirjam

       
adro's avatar
adro
110 posts
15 years ago
adro's avatar adro

I’m having an issue with .htaccess Generator and the GeoFinder module. Everything works fine, until the user does a search in GeoFinder with a comma. (i.e. Toronto, ON) I get the “Disallowed Key Characters” error on a white screen. I tried removing the “?” after index.php like so:

RewriteRule ^(.*)$ /index.php/$1 [L]

This seems to solve the GeoFinder “Disallowed Key Characters” problem, but now LG htaccess generator is not doing what it’s supposed to. Or more specifically, the ‘Include Method’ is not working right. Any page I try to access, just takes me back to the homepage. I have even tried adding:

AcceptPathInfo On

before the rewrite rules in my .htacess file with no success.

If anyone could please help me out with this, it would be much appreciated!

Thanks in advance, Adam

       
First 9 10 11 12 13

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.