Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8733723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:42:35+00:00 2026-06-13T09:42:35+00:00

hi all i have this question as my rewrite rule is shown below. But

  • 0

hi all i have this question as my rewrite rule is shown below. But everytime when i am using this code the js file wont work.

RewriteRule ^([^thumb].*\.[jJ].*)$ /images/files/w.php?i=$1

Can anyone tell me where went wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:42:36+00:00Added an answer on June 13, 2026 at 9:42 am

    In order to handle more than just jpgs you can change it to be the following:

    RewriteRule ^([^thumb].*\.(jpe?g|png|gif).*)$ /images/files/w.php?i=$1
    

    This will covers jpg, jpeg, png and gif file extensions while not matching javascript files.

    Note: [^thumb].* won’t match any file names starting with t, h, u, m, or b, (e.g., test.jpg, home.jpg, umbrella.jpg, monster.jpg, or beach.jpg won’t match) not just files starting with thumb..., for the whole word, thumb, you need a negative lookahead (?!regex). To make the rule not match files starting with “thumb” this is what the rule should look like:

    RewriteRule ^((?!thumb).*\.(jpe?g|png|gif).*)$ /images/files/w.php?i=$1
    

    One last problem the rule handles text after the file extension which I assume means that you may have urls that look like:

    http://www.example.com/test.png?foo=a&b=baz

    Your rule will create a rewrite that ends up looking like

    http://www.example.com/images/files/w.php?i=test.png?a=foo&b=baz

    Which is not a valid url as there are now two ?s in the query string. To fix this I’d go with the following regex.

    RewriteRule ^((?!thumb).*\.(?:jpe?g|png|gif))\??(.*)$ /images/files/w.php?i=$1&$2
    

    This regexp rule will result in a properly formed url

    http://www.example.com/images/files/w.php?i=test.png&a=foo&b=baz

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ASP.Net MVC3 is cool and all but I have this question more out of
I have an ObjectDataSource (but perhaps this question is the same for all kinds
Dear all,Now i have this question in my java program,I think it should be
Inspired by the discussion in this question . We have all been taught that
All, have I gone mental (this is not the question). I want to convert
the question explains it all. For instance, if I have a NSDictionary like this
Hi all I have this code to check if an item from a textbox
Okay, so I have this CSV file of products and all the products have
This may sound like a strange question, but i need to redirect all .rar
I know that this question have been asked several times. But I can't get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.