help me for this bugs

Started on the old forum in October 2012 · view the original in the archive · old links redirect here

3 replies · 489 views · started 14 years ago · 1 min read

2 participants
hi_jakkk Developer · 52 posts #1

i use this htaccess in my site

RewriteRule w_(.*)\.html$ /index.php?dir=$1
RewriteRule file_(.*)\.html$ /file.php?file=$1

RewriteRule wx_(.*)_(.*)\.html$ /index.php?dir=$1&page=$2

And the problem is when i upload a file that has a _ in its filename it will cause the error when i tried to click that uploaded file..error is redirect to main page..but the rest file is n0t a pr0blem...help please...

hi_jakkk Developer · 52 posts #3

timo wrote: just simply use base64_encode($filename)

But how bro?can i add that in htaccess?

Added after 3 minutes:

i think it only fix in htaccess but im n0t expert in that 🙁

timo Junior · 30 posts #4

hi_jakkk wrote: But how bro?can i add that in htaccess?

Added after 3 minutes:

i think it only fix in htaccess but im n0t expert in that :(

in your php code simple replace your href with this

<a href="./file_'.base64_encode($filename).'.html">'.$filename.'</a>

in download php code you should decode that

$file = base64_decode($_GET['file']);

thats it!

OR

in your htaccess RewriteRule file_(.*).html$ /file.php?file=$1 <=(you have to change this because it conflict with the filename because of underscore sign)

RewriteRule file=(.*).html$ /file.php?file=$1

OR

in upload php code

$filename = $_FILES["uploaded"]['name'];

$filename = str_replace("_","", $filename);

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close