|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a rewrite setup but it's getting the path incorrect. I have:
domain.com/news/300.html to go to: domain.com/article.php?news_id=300 but the problem is that it thinks that /news is part of the path for the images folder (e.g. domain.com/news/images instead of domain.com/images) so all my images break. It seems like it would just use the folder level that script was envoked by. Any ideas? Is this an Apache config or a rewrite error? |
|
#2
|
|||
|
|||
|
You need EXTERNAL Redirect, not INTERNAL.
Start here -> http://www.apache.org/docs/misc/rewriteguide.html and look under "Trailing Slash Problem". ############################################# Solution: The solution to this subtle problem is to let the server add the trailing slash automatically. To do this correctly we have to use an external redirect, so the browser correctly requests subsequent images etc. If we only did a internal rewrite, this would only work for the directory page, but would go wrong when any images are included into this page with relative URLs, because the browser would request an in-lined object. For instance, a request for image.gif in /~quux/foo/index.html would become /~quux/image.gif without the external redirect! ############################################# |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > rewrite and path confusion |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|