Forum Moderators: phranque
My problem is that when I use a forward slash after "^article" in the below set of rules, I do not receive an error page when attempting to access the URL, but I get, for a lack of a better term, a funky looking page with the correct data on what seems to be the right page. No images display, links look generic, banner on the right is actually displayed on left, etc. I know it's the forward slash after "^article" doing this because anything else after "^article" will work just fine.
For example, the following works properly when using an underscore after "^article".
Options +FollowSymLinks
RewriteEngine on
ReWriteBase /
RewriteRule ^article_([^./]+)$ /details.php?articleID=$1/ [L]
However, the following causes the problem stated above when using a forward slash after "^article"
Options +FollowSymLinks
RewriteEngine on
ReWriteBase /
RewriteRule ^article/([^./]+)$ /details.php?articleID=$1/ [L]
Is there something I'm doing wrong? Could/Should I try something else? Any help would be greatly appreciated. Thanks.
The two ways to fix it while still using slashes in your article-name URLs are to either use server-relative or canonical links, or to detect the requests that contain additional subdirectory levels, and rewrite them to correct them. If you have a choice, don't use slashes. If not, then use
<img src="/images/logo.gif"> or <img src="http://www.example.com/images/logo.gif"> instead of <img src="images/logo.gif">
Jim