I have to move a Zend website on a shared hosting which is using Pretty URL but css files doesn't load when params is added. Before moving, i want to test with server ip adress to be sure.
For exemple
-SERVER_IP/~username/en (works)
-SERVER_IP/~username/en/news (fails because it search in "en" folder)
I would like to redirect every css files from path /css/ to my real css folder which has many css files.
I want same thing for every path /images/ and /js/ and maybe others.
Can someone help me ?
thank you!
UPDATE 1
Does path relative change between domain.com and SERVER_IP/~username? When i set /css/style.css, it search for SERVER_IP/css/style.css instead of SERVER_IP/~username/css/style.css. If i can make it works for both, my problems will be gone. But I can't test with domain because i don't have any for the moment
UPDATE 2
I've modified my hosts file in C:\windows\system32\drivers\etc\ to simulate with a real domain. As i expect, relative path aren't working the same ways.
- SERVER_IP/~username/index.php <img src="/img/world.jpg" /> => SERVER_IP/img/world.jpg (BAD, note i've lose ~username)
- www.domain.com/index.php <img src="/img/world.jpg" /> => www.domain.com/img/world.jpg (perfect)
With that change, all my path are good now and no need to redirect anything. But another problem appears. Since i use www.domain.com, index.php is shown in the URL and I don't want this : www.domain.com/index.php/en
UPDATE 3
I've found this rule : RewriteRule ^index.php(.*)$ http://%{HTTP_HOST}/$1 [R=301,NC,L]
. index.php is now remove but when i'm on www.domain.com/en, it looks like en is not in the request uri and all my links move to www.domain.com/en/en/...
I paste here my .htaccess content :
Options +FollowSymLinks
Options -Indexes
RewriteEngine on
RewriteBase /
DirectoryIndex index.php index.html
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^index.php(.*)$ http://%{HTTP_HOST}/$1 [R=301,NC,L]
UPDATE 4
I got it ! I describe my entire solution below!