Jump to content
xisto Community
Sign in to follow this  
Amezis

[^] Need Help With Regex (for .htaccess)

Recommended Posts

Well, I ran into a problem. I tried to make a code that matched everything, except strings containing the word "php", "gif", "jpg" etc. I tried doing something like this, but it didn't work:

 

([^\b(php|gif|jpg)\b]+)$

But that works just like if I would do this:
([^phgifj]+)$

That code is a part of a larger code that only works partially:

 

RewriteEngine onRewriteRule   ([^\b(php|gif|jpg)\b]+)$	item.php?n=$1

Some strings, such as asd works, but fgh doesn't work.

 

Any help for either of these problems would be greatly appreciated! As you might see, I'm no master with regex... well, not yet :)

Edited by Amezis (see edit history)

Share this post


Link to post
Share on other sites

It didn't help me much, but I finally found out how I could fix everything. Here's the code I'm using:

RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteRule   (.+)$	item.php?n=$1

:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.