Web Server Configuration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Server Configuration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 9th, 2005, 11:08 AM
liljoeyjordison liljoeyjordison is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 12 liljoeyjordison User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 22 sec
Reputation Power: 0
Rewrite Engine + CSS files

Hi,
A friend gave me some htaccess code, which looks like this -
Code:
<Files />
ForceType application/x-httpd-php
</Files>

RewriteEngine on
RewriteBase /

RewriteRule ^.htaccess$ - [F]

RewriteRule ^([A-z,0-9,_,-]+)/?$              $1.php     [QSA]
RewriteRule ^([A-z,0-9,_,-]+)/index\.html$    $1.php     [QSA]
however, when I try and use a css file- it fails. I tried, (working to the best of my ability and intuition) adding:
Code:
RewriteRule ^([A-z,0-9,_,-]+)/.css?$              $1.css     [QSA]
to the end, but that seemed to fail. any ideas what I can do?

Reply With Quote
  #2  
Old September 26th, 2005, 01:13 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 24 m 44 sec
Reputation Power: 7
comment out the line with the css in it, and that should remove the erros you're getting.
__________________
Apache Expert

Reply With Quote
  #3  
Old September 26th, 2005, 05:31 AM
liljoeyjordison liljoeyjordison is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 12 liljoeyjordison User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 22 sec
Reputation Power: 0
Quote:
Originally Posted by asp_man
comment out the line with the css in it, and that should remove the erros you're getting.

I added that line to try and allow me to put css files in my site. Without that line (or something similar) It can't find css files.

Reply With Quote
  #4  
Old September 26th, 2005, 09:57 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
How are you referencing the CSS file in your HTML?

Reply With Quote
  #5  
Old September 26th, 2005, 11:49 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 24 m 44 sec
Reputation Power: 7
Quote:
Originally Posted by MadCowDzz
How are you referencing the CSS file in your HTML?


i was just about to ask that.

Reply With Quote
  #6  
Old September 26th, 2005, 12:06 PM
liljoeyjordison liljoeyjordison is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 12 liljoeyjordison User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 22 sec
Reputation Power: 0
@import "url.css" ;

Reply With Quote
  #7  
Old September 26th, 2005, 01:34 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
the easiest solution could be to store your CSS files in a subdirectory under the root.

Then to reference it, use the absolute path... For example: '/css/myfile.css'

Reply With Quote
  #8  
Old September 26th, 2005, 11:00 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 24 m 44 sec
Reputation Power: 7
Quote:
Originally Posted by liljoeyjordison
@import "url.css" ;


that's the xhtml standard but when first tried that out, it never worked, and always stuck with this way of including css files.

css code Code:
Original - css code Code
    <link rel="stylesheet" type="text/css" href="/includes/delay-css.css"/>

Reply With Quote
  #9  
Old September 27th, 2005, 04:10 AM
liljoeyjordison liljoeyjordison is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 12 liljoeyjordison User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 22 sec
Reputation Power: 0
Quote:
Originally Posted by asp_man
that's the xhtml standard but when first tried that out, it never worked, and always stuck with this way of including css files.

css code Code:
Original - css code Code
    <link rel="stylesheet" type="text/css" href="/includes/delay-css.css"/>


I'll try this now- it's just that without the htaccess it works fine.

Reply With Quote
  #10  
Old September 28th, 2005, 01:14 AM
Sha Sha is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 6 Sha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 12 m 50 sec
Reputation Power: 0
Quote:
Originally Posted by liljoeyjordison
Hi,
RewriteRule ^([A-z,0-9,_,-]+)/?$ $1.php [QSA]


Due to this rule all *.css files (and every other file) also rewritten into $1.php
If this is what you are expecting ?

If not then try something like this:

RewriteCond $1 !^.*\.css$
RewriteRule ^([A-z,0-9,_,-]+)/?$ $1.php [QSA]

Reply With Quote
  #11  
Old September 28th, 2005, 06:18 AM
liljoeyjordison liljoeyjordison is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 12 liljoeyjordison User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 22 sec
Reputation Power: 0
Aaah
RewriteCond ...
" Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo. ''

Reply With Quote
  #12  
Old September 28th, 2005, 11:30 AM
Sha Sha is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 6 Sha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 12 m 50 sec
Reputation Power: 0
Quote:
Originally Posted by liljoeyjordison
Aaah
RewriteCond ...
" Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo. ''


Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Server Configuration > Rewrite Engine + CSS files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT