Mod_rewrite question

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
driesdk
Forum Newbie
Posts: 6
Joined: Fri Aug 05, 2005 7:33 pm

Mod_rewrite question

Post by driesdk »

Hi guys
I have this problem, I'm using a script where for example the profile page of a user is: http://www.abc.com/?L=users.profile&id=222
I want to make a Mod_rewrite rule to make it: http://www.abc.com/222

Now, I have made something and it's this:

Code: Select all

RewriteEngine On

RewriteOptions MaxRedirects=10

RewriteCond %{REQUEST_FILENAME} /data/ [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.* - [L]

RewriteRule ^([a-z0-9]+)/? ?L=users.profile&id=$1 [L]
RewriteRule ^([a-z0-9]+)/? ?L=users.profile&username=$1 [L]
But... everyhting works but from then on I can't access the other links on the profile page, because, then it's something like: http://www.abc.com/222?L=users.myaccount instead of http://www.abc.com/?L=users.myaccount

So, I guess the problem is the script isn't using strictpaths (complete url's)
Is there some solution to this?
Greetz,
driesdk
Forum Newbie
Posts: 6
Joined: Fri Aug 05, 2005 7:33 pm

Post by driesdk »

nobody an idea if this is possible?
Post Reply