Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> [^] Need Help With Regex (for .htaccess)
Amezis
post Oct 16 2006, 05:47 PM
Post #1


Privileged Member
*********

Group: Members
Posts: 535
Joined: 14-February 05
From: Oslo, Norway
Member No.: 3,759



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:

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


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


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

CODE
RewriteEngine on

RewriteRule   ([^\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 wink.gif

This post has been edited by Amezis: Oct 17 2006, 02:06 PM
Go to the top of the page
 
+Quote Post
hts
post Oct 16 2006, 07:23 PM
Post #2


Advanced Member
*******

Group: Members
Posts: 138
Joined: 30-September 06
From: Iasi, Romania
Member No.: 30,851



http://www.javascriptkit.com/howto/htaccess10.shtml

see here..I think you will find what you are looking for..of course, that code must be adapted to suit your needs..but it`s easy to understand smile.gif
Go to the top of the page
 
+Quote Post
Amezis
post Oct 17 2006, 02:17 PM
Post #3


Privileged Member
*********

Group: Members
Posts: 535
Joined: 14-February 05
From: Oslo, Norway
Member No.: 3,759



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

CODE
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule   (.+)$    item.php?n=$1


smile.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. .htaccess?(4)
  2. .htaccess(2)
  3. Need .htaccess Help(1)
  4. How To: Change Your Website's Index File(18)
  5. Cleaning User Input With Regex(1)
  6. .htaccess Redirect Question(6)
  7. Htaccess To Block Bots(7)
  8. .htaccess Query(0)
  9. .htaccess File In Hosting Space Modification(5)
  10. Mod_rewrite And Htaccess(5)
  11. .htaccess Files Supported?(6)
  12. How To Modify .htaccess To Protect A Directory?(3)
  13. I Need Help To Use Htaccess To Allow Only My Server To See A Directory(4)
  14. .htaccess Override(6)
  15. .htaccess-style Login System And Php(13)
  1. Can't Upload .htaccess And .mdu File...(5)
  2. Renaming Your Url's(3)
  3. Using The Rewriterule(0)
  4. Path To /.htaccess Folder?(2)
  5. Problem With Htaccess (i Guess)...(0)
  6. I Need A Hand With Some Htaccess Login Stuffs!(0)
  7. .htaccess Problem(2)
  8. Dynamic Signature - Yet Another Way To Do It(0)
  9. Site Management Tools: Look Before You Leap!(3)
  10. .htaccess(3)
  11. Perl Regular Expresions Regex(2)
  12. Help Needed: Rewritting Uris From .htaccess(0)
  13. Is Wildcards Allowed In Htaccess?(0)


 



- Lo-Fi Version Time is now: 6th September 2008 - 07:14 PM