views:

15

answers:

0

I am building a Dynamic web site from scratch for the first time so I am new at this.

I need to match this URL: www.domain.org/world/2.html with this: www.domain.org/index.php?html=world&rss=2

For that purpose I am using this rewrite rule: RewriteRule ^([^/])/([^/]).html$ /index.php?html=$1&rss=$2 [L]

And this should be working, but it is not!

If I write: RewriteRule ^([^/])/([^/]).html$ /index.php?html=$1&rss=$2 [R] the site redirects me to the right URL and everything is working properly.

However, when I change the modifier [R] to [L] again, I receive a very strange page. It is the same that I need, but the css file is not loaded. Consequently, the internal URL is not exactly the same with what I need. When I echo the $_GET[html] and $_GET[rss] variables, then they are the correct ones too. Additionally, when I go from link www.domain.org/world/2.html to another link from the menu, its builds like this: www.domain.org/world/2.html/environment.html, instead of www.domain.org/environment.html

So, I guess that the problem is with the organization of my site. The .htacces is in one directory. The template and css file is in another directory and the .php files handling different pages are in different directories. But then again www.domain.org/index.php?html=world&rss=2 works perfectly!!! Probably the .htaccess leads me to some wrong directory, but I do not know how to fix it.

So I am really confused where is the problem?! Please, if somebody has a clue, I will be very grateful to hear it.

Thank you for your time and consideration.