Question mark in css url
Posted: 29 November 2008 06:14 PM   [ Ignore ]  
Summer Student
Total Posts:  22
Joined  11-12-2008

I installed this extension:
http://leevigraham.com/cms-customisation/expressionengine/lg-htaccess-generator/

which worked fine, then I removed the index.php from URLs:
Control Panel Home › Admin › System Preferences › General Configuration

This works as I want.

However, it has mucked up my css links.

Here is the code I use:

<link rel="stylesheet" type="text/css" media="screen" href="{stylesheet=styles/typography}" />

and this is the html is generates:

<link rel="stylesheet" type="text/css" media="screen" href="http://www.mydomain.com/?css=styles/typography.v.1227994514" />

That url does not exist. However if I remove the ? from after the domain name, it works fine. So how do I fix this? Do I have to hardcode my css links? I’d rather not do that.

Thanks!

Profile
 
 
Posted: 29 November 2008 08:00 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  421
Joined  11-17-2008

I have the “?” in my css link and it still works.  I’m guessing the code to take out the index.php from the URL isn’t working totally right.  I’m using the same extension, but I remember I had to tweak it a bit to get it to work.  Here’s what I’m using in that particular section of the htaccess file:

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

Try that and let me know if it works.

 Signature 

- cody

Plugins: AJAX Pagination | AJAX Comments
Extensions: jQuery Quick Save (updated) | Goto Latest Comment
FieldTypes: MS Img Saver
MeanStudios.com

Profile
 
 
Posted: 30 November 2008 09:59 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  22
Joined  11-12-2008

Hi no luck with that, in fact, it meant I couldn’t access any of my pages.

Profile
 
 
Posted: 09 January 2009 03:43 AM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  281
Joined  06-24-2007

Tom I am having the same problem.  Any fix?

 Signature 

Chad Crowell | Encaffeinated, Inc. | Formerly Web Inception | @chadcrowell | @encaffeinated

Profile
 
 
Posted: 09 January 2009 03:54 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  281
Joined  06-24-2007

Found the problem using LG HTaccess:

For the section of the code that removes index.php you have to remove the | before “members” on the next to last line.  I actually looked at my htaccess after using this to regenerate the file and saw || in the list of template groups and pages.  From some previous experiences I knew immediately this was the issue.  So change this:

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

To this:

RewriteCond %{REQUEST_URI} ^/({ee:template_groups}|{ee:pages}members|P[0-9]{2,8}) [NC]

And your problem might go away.

 Signature 

Chad Crowell | Encaffeinated, Inc. | Formerly Web Inception | @chadcrowell | @encaffeinated

Profile
 
 
Posted: 09 January 2009 05:56 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  22
Joined  11-12-2008

Nice one, I’ll give that a go. Although at the moment, I upload my css via ftp and hard code the link. I prefer this actually, rather than editing the css inside the EE templates.

Profile
 
 
Posted: 19 February 2009 06:06 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  293
Joined  08-04-2007

Thanks Chad.  This solved my CSS issue after installing the lg.htacccess extension.

 Signature 

Paul Burton | 16toads Design

Profile
 
 
Posted: 30 August 2009 02:19 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  121
Joined  02-16-2005
Paul B - 19 February 2009 06:06 AM

Thanks Chad.  This solved my CSS issue after installing the lg.htacccess extension.

Yes, it also solved my similar CSS problem (stylesheets not being applied). The double “pipe” character is a definite problem.

Somewhere in this thread, Leevi was talking about updating LG .htaccess Generator to fix this by doing something like this:

RewriteCond %{REQUEST_URI} ^/({ee:template_groups}{if pages}|{ee:pages}{/if}|members|P[0-9]{2,8}) [NC]

That would be great, but it won’t work. I tried it and it produces a 500 internal server error for both front and back ends. That’s because the EE “if” tags are not parsed correctly (or at all), and they end up as literals, with curly braces, in the generated .htaccess file, and that takes your site right down.

So… if you don’t use the Pages module, and know you never will, you can leave the “ee:pages” tag in there with no pipe character, or you can just remove the “ee:pages” tag (and the extra pipe) altogether. However, if you ever do use the Pages module, your site will break if the tag is in there with no pipe, or if you don’t use the tag at all, you won’t get automatic generation of those pages by the LG extension.

Unless Leevi comes up with a way to parse “if” tags in this extension, you’ll have to make a note to yourself somewhere to add the tag if you ever use the Pages module.

Leevi, thanks for a great extension that allowed me to stop apologizing for “index.php” in EE URLs. That, plus adopting a templating structure that consists of a template group for every site section with only an index in each one (plus a template group of embeds), and I finally have what I’ve long wanted for URLs:

http://domain.com/site-section/site-page/

Yay.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120580 Total Logged-in Users: 48
Total Topics: 126616 Total Anonymous Users: 29
Total Replies: 665631 Total Guests: 308
Total Posts: 792247    
Members ( View Memberlist )