Wrong website loaded when other requested

Joel Goldstick joel.goldstick at gmail.com
Thu Jun 13 11:35:46 EDT 2013


So Nick, I am top posting because I don't think you read your replies.  I
replied yesterday.

Read this line below.  Read the line below.  READ it.  READ IT.. each
letter.  READ it:

[Tue Jun 11 21:59:31 2013] [error] [client 79.103.41.173]
FileNotFoundError: [Errno 2] \\u0394\\u03b5\\u03bd
\\u03c5\\u03c0\\u03ac\\u03c1\\
>
> u03c7\\u03b5\\u03b9 \\u03c4\\u03ad\\u03c4\\u03bf\\u03b9\\u03bf
> \\u03b1\\u03c1\\u03c7\\u03b5\\u03af\\u03bf \\u03ae
> \\u03ba\\u03b1\\u03c4\\u03ac\\u03bb\\u03bf\\u03b3\\u03bf\\u03c2:
> '/home/nikos/public_html//home/dauwin/public_html/index.html', referer:
> http://superhost.gr/
> [/code]
>
DO YOU SEE THIS PART:
 '/home/nikos/public_html//home/dauwin/public_html/index.html', referer:
http://superhost.gr/

Do you see that it prepends your nikos path the your dauwin path and file
name.  It isn't replacing one with the other.  Somewhere in your SFBI mess
of code you perhaps have set the nikos path as the start of a filename.
Check that out


DID YOU READ THIS?  DID YOU THINK ABOUT IT.  Also look up SFBI.  It is a
good name for you

> [/code]
>



On Wed, Jun 12, 2013 at 4:35 PM, Joel Goldstick <joel.goldstick at gmail.com>wrote:

>
>
>
> On Wed, Jun 12, 2013 at 1:33 PM, Νικόλαος Κούρας <support at superhost.gr>wrote:
>
>> ======================
>> RewriteEngine Off
>> RewriteCond %{REQUEST_FILENAME} -f
>> RewriteRule ^/?(.+\.html) /cgi-bin/metrites.py?file=%{**REQUEST_FILENAME}
>> [L,PT,QSA]
>> ======================
>>
>> [code]
>> file = form.getvalue('file')
>> page = form.getvalue('page')
>>
>> if not page and os.path.exists( file ):
>>         # it is an html template
>>         page = file.replace( '/home/dauwin/public_html/', '' )
>> elif page or form.getvalue('show'):
>>         # it is a python script
>>         page = page..replace( '/home/dauwin/public_html/cgi-**bin/', '' )
>> else:
>>         #when everything else fails fallback
>>         page = "index.html"
>>
>> ....
>> ....
>>
>>         if page.endswith('.html'):
>>                 with open( '/home/dauwin/public_html/' + page,
>> encoding='utf-8' ) as f:
>>                         htmlpage = f.read()
>>                 htmlpage = htmlpage % (quote, music)
>>                 template = htmlpage + counter
>>         elif page.endswith('.py'):
>>                 pypage = subprocess.check_output(
>> '/home/dauwin/public_html/cgi-**bin/' + page )
>>                 pypage = pypage.decode('utf-8').**replace(
>> 'Content-type: text/html; charset=utf-8', '' )
>>                 template = pypage + counter
>>
>>         print( template )
>> [/code]
>>
>> Everything as you see point to 'dauwin' username, yet the error still
>> says:
>>
>> [code]
>> [Tue Jun 11 21:59:31 2013] [error] [client 79.103.41.173]   File
>> "/home/nikos/public_html/cgi-**bin/metrites.py", line 219, in <module>,
>> referer: http://superhost.gr/
>> [Tue Jun 11 21:59:31 2013] [error] [client 79.103.41.173]     with open(
>> '/home/nikos/public_html/' + page, encoding='utf-8' ) as f:, referer:
>> http://superhost.gr/
>> [Tue Jun 11 21:59:31 2013] [error] [client 79.103.41.173]
>> FileNotFoundError: [Errno 2] \\u0394\\u03b5\\u03bd
>> \\u03c5\\u03c0\\u03ac\\u03c1\\**u03c7\\u03b5\\u03b9
>> \\u03c4\\u03ad\\u03c4\\u03bf\\**u03b9\\u03bf
>> \\u03b1\\u03c1\\u03c7\\u03b5\\**u03af\\u03bf \\u03ae
>> \\u03ba\\u03b1\\u03c4\\u03ac\\**u03bb\\u03bf\\u03b3\\u03bf\\**u03c2:
>> '/home/nikos/public_html//**home/dauwin/public_html/index.**html',
>> referer: http://superhost.gr/
>> [/code]
>>
>>
>> Notice that you have the file path you want concatenated to your
> /home/nikos/... stuff in the line above.  Look in your code to find out
> why. Fix that.  Lather, rinse, repeat
>
>> Why is pointing to /home/nikos isntead of /home/dauwin ?
>>
>> this is what a smash my head to the wall to understand.
>> --
>> http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list>
>>
>
>
>
> --
> Joel Goldstick
> http://joelgoldstick.com
>



-- 
Joel Goldstick
http://joelgoldstick.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130613/07bc1773/attachment.html>


More information about the Python-list mailing list