Jump to content

RewriteRule exceptions/conditions


xzazx

Recommended Posts

Okay well I'm making a simple thing.
When you type in : www.myserver.com/Username, it should direct you to www.myserver.com/showprofile.php?id=Username

I made a .htaccess file with the following code:

[code=php:0]
RewriteEngine On
RewriteRule ^(.*)$ /showprofile.php?id=$1 [L]
[/code]

That works perfectly, does what I want, BUT (yes there's always a but ) when I try to open other files which are in the root folder, such as index.php or viewforum.php or so, it just does the same with the files (offcourse, because that's what I programmed in the .htaccess), and so kicks in showprofile.php?id=index.php ... Which is offcourse not what I want.

Now I read about conditions..
And want to ask if you people can help me with a solution condition code to filter those files out (so, not put them in the url and just threat them as normal).

Thanks in advance, hope to hear from you

Greets,

Maikel
Link to comment
https://forums.phpfreaks.com/topic/33762-rewriterule-exceptionsconditions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.