|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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] Code:
RewriteRule ^([A-z,0-9,_,-]+)/.css?$ $1.css [QSA] |
|
#2
|
|||
|
|||
|
comment out the line with the css in it, and that should remove the erros you're getting.
__________________
Apache Expert |
|
#3
|
|||
|
|||
|
Quote:
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. |
|
#4
|
||||
|
||||
|
How are you referencing the CSS file in your HTML?
|
|
#5
|
|||
|
|||
|
Quote:
i was just about to ask that. |
|
#6
|
|||
|
|||
|
@import "url.css" ;
|
|
#7
|
||||
|
||||
|
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' |
|
#8
|
|||
|
|||
|
Quote:
that's the xhtml standard but when first tried that out, it never worked, and always stuck with this way of including css files. |
|
#9
|
|||
|
|||
|
Quote:
I'll try this now- it's just that without the htaccess it works fine. |
|
#10
|
|||
|
|||
|
Quote:
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] |
|
#11
|
|||
|
|||
|
Aaah
RewriteCond ... " Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo. '' |
|
#12
|
|||
|
|||
|
Quote:
![]() |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Server Configuration > Rewrite Engine + CSS files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|