Welcome Guest, Not a member yet? Register   Sign In
Help with .htaccess
#1

[eluser]Buso[/eluser]
I have moved to a new server and I can't make .htaccess work

Im using this one, which used to work fine in my last server:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt|template|css|images|javascript|\*\.jpg|\*\.gif|\*\.css|\*\.js)
RewriteRule ^(.*)$ index.php/$1 [L]

But now it doesn't seem to work.

My host gave me a temporary url like this (im still wating for my domain nameservers to get updated):

http://12.345.67.890/~something/

That url points to my /www directory, where I placed my CI components:
Code:
/www
  /system
  /css
  .htaccess
  .index.php

If I remove the .htaccess, it works, but i have to write index.php on every url.

But anyway I noticed that the image relative paths from de .css stylesheets weren't working. I had to add "/~something" at the beginning of each relative path. That confuses me since there is no "/~something" directory (it still could be an mod_rewrite alias for /www, but why do I have to write it if it is a relative path and /www is my root?)

Sry for all the newbie questions, but I really am in a hurry =p
#2

[eluser]skunkbad[/eluser]
This is the standard .htaccess that I start with for all CI projects:

Code:
RewriteEngine On
RewriteBase /
RewriteRule ^(system|application|cgi-bin) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
#3

[eluser]Buso[/eluser]
[quote author="skunkbad" date="1257601750"]This is the standard .htaccess that I start with for all CI projects:

Code:
RewriteEngine On
RewriteBase /
RewriteRule ^(system|application|cgi-bin) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
[/quote]

have you ever tried that with a url like the temporary one I have??

it's not working for me
#4

[eluser]n0xie[/eluser]
Code:
RewriteBase /~something/
#5

[eluser]Buso[/eluser]
thanks a lot!! Confusednake:

now i only need to make the relative paths of the images from css work

anything you would add to that .htaccess??
#6

[eluser]n0xie[/eluser]
In the HEAD of your html document above any css or js include try:
Code:
<base href="http://12.345.67.890/~something/" />

Else take a look here
#7

[eluser]Buso[/eluser]
[quote author="n0xie" date="1257613585"]In the HEAD of your html document above any css or js include try:
Code:
<base href="http://12.345.67.890/~something/" />

Else take a look here[/quote]

is that supposed to modify also the relative paths written inside the .css files??

example:

>> style.css
Code:
body {
  background:url('/css/images/background.gif') repeat;
}


edit: Ok everything is working now. Had to change paths like this
background:url("/css/images/b.jpg");

to this

background:url('../css/images/b.jpg');




Theme © iAndrew 2016 - Forum software by © MyBB