View previous topic :: View next topic |
Author |
Message |
Yxine -
Joined: 26 Jan 2007 Posts: 5
|
|
Back to top |
|
|
roganty -
Joined: 08 Jun 2004 Posts: 357 Location: Bristol, UK
|
Posted: Wed Oct 03, 2007 6:56 pm Post subject: Re: Non-php files problem |
|
|
Yxine wrote: | Hello! I have following problem: when useing url rewrite my css, gif and etc file are also rewriting...
But when I go to my url http://localhost/site1, all my styles and graphics disappearing from the page output. I fill they also been rewritten, but how to fix that problem?
A bit of code of page:
Code: |
<html>
<head>
<link rel="stylesheet" type="text/css" href="style_new.css">
|
The problem that last line is not loading anymore! Help, please! |
Yxine,
Its because you are using relative paths.
using your example the browser is asking for /site1/about/style_new.css
but it doesn't exist!
so you have to use absolute paths in your urls so change them to /site1/style_new.css or /site1/image.gif etc _________________ Anthony R
Roganty | Links-Links.co.uk |
|
Back to top |
|
|
Yxine -
Joined: 26 Jan 2007 Posts: 5
|
Posted: Thu Oct 04, 2007 9:25 am Post subject: Re: Non-php files problem |
|
|
roganty wrote: | so you have to use absolute paths in your urls so change them to /site1/style_new.css or /site1/image.gif etc |
Even if I change all my pathes to full, the rewritting engine will make them "bad".
I changed path to style to http://localhost/site1/style.css but it is still rewritting to http://localhost/site1/index.php?page=style.css
Because my rule is rewriting all after /site1/ I think this case is more difficult and requires more rules or conditions...
The only thing that helps if adding any additionsl string to Virtual Path Regular Expression (example: /site1/j/(.*)), but I don't need any j/ in my address and this is the problem. |
|
Back to top |
|
|
roganty -
Joined: 08 Jun 2004 Posts: 357 Location: Bristol, UK
|
Posted: Fri Oct 05, 2007 1:49 am Post subject: Re: Non-php files problem |
|
|
At least the rewrite rule is working! lol!
Yxine wrote: | Because my rule is rewriting all after /site1/ I think this case is more difficult and requires more rules or conditions...
The only thing that helps is adding any additional string to Virtual Path Regular Expression (example: /site1/j/(.*)), but I don't need any j/ in my address and this is the problem. |
Ok, Ive had another look at the regular expression you are using!
You could try the following:
^/site1/([a-zA-Z0-9]*)/?$
So that it only excepts the letters a-z, A-Z and the number 0-9
Or if you only have a limited number of pages you could try
^site1/(about|news)/?$
To add more pages separate them with the pipe character (|)
In both cases i've added "/?$" which basically means:
/ repeated at most once followed by line end
Also as a suggestion you should set up your php page so that it displays the index page by default
Does that help? _________________ Anthony R
Roganty | Links-Links.co.uk |
|
Back to top |
|
|
Yxine -
Joined: 26 Jan 2007 Posts: 5
|
Posted: Fri Oct 05, 2007 3:37 am Post subject: |
|
|
Thanks! Both rules are working great! |
|
Back to top |
|
|
roganty -
Joined: 08 Jun 2004 Posts: 357 Location: Bristol, UK
|
Posted: Sat Oct 06, 2007 2:05 pm Post subject: |
|
|
Yxine wrote: | Thanks! Both rules are working great! |
Glad I could help! _________________ Anthony R
Roganty | Links-Links.co.uk |
|
Back to top |
|
|
|