rewrite probmem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hackerman
Forum Newbie
Posts: 3
Joined: Thu Aug 23, 2007 3:08 pm

rewrite probmem

Post by hackerman »

Hello.

I've problem with mod_rewrite. The code:

Code: Select all

 
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ?do=$1 [QSA,L]
 
It works, but there is a little bug. If I type, for example, "mypage.com/aaa/bbbbb/cc/", there disappear CSS. But if I type there only one value "mypage.com/aaa", then all is right. What I have to do to fix that bug?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Re: rewrite probmem

Post by JAM »

Not to familiar withth eactual syntax, sorry. Some thoughts tho...
Cant you exclude css-hits with !\.css$ or something similiar? Differences with REQUEST_URI instead of REQUEST_FILENAME?
hackerman
Forum Newbie
Posts: 3
Joined: Thu Aug 23, 2007 3:08 pm

Re: rewrite probmem

Post by hackerman »

Now I have a new problem with mod_rewrite. The code

Code: Select all

 
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*)$ ?do=$1&id=$2 [QSA,L]

Code: Select all

This is if I want link, which have ID, for example, news.php?id=5 (news/5), but if I need just simple news.php (news/), then that script doesn't work.
Post Reply