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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.