Jump to content

What's wrong with these rules?


nobodyk

Recommended Posts

If the user goes to thumb-231313.jpg it takes them to index.php?v=$1 rule

Any thoughts?

RewriteEngine on
RewriteCond %{HTTP_HOST} !^uploadpic\.org$ [NC]
RewriteRule ^(.*)$ http://uploadpic.org/$1 [QSA,L,R=301]
AddType application/x-httpd-php .html
php_flag register_globals on
RewriteRule ^thumb-(.*).jpg$ view-image.html?img=$1&w=160&h=160 [QSA]
RewriteRule ^showpic-(.*)/(.*)$ view-pic.html?img=$1 [QSA]
RewriteRule ^download-(.*)/(.*)$ view-pic-original.html?img=$1&dl=1 [QSA]
RewriteRule ^showoriginal-(.*)/(.*)$ view-pic-original.html?img=$1 [QSA]
RewriteRule ^([^/]*)\.html$ /index.php?v=$1 [L]

Link to comment
Share on other sites

It would appear that because you're rewriting all traffic to .html files to index.php, you're rewriting the image to the html file, and then this is being rewritten to the php file, per the last RewriteRule. If you're saying this behaviour is unwanted, try using the last rule flag [L].

Link to comment
Share on other sites

As alex3 has correctly identified, the problem is that your rewritten address matches another pattern further down the page (the last one). The solution offered should have fixed this issue. If the problem is indeed solved can you please mark the topic 'Solved' using the 'Mark Solved' button located at the bottom left corner of a thread you started.

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.