Re: base url includes SCRIPT_NAME, which contains too much stuff

will kahn-greene <[email protected]> Sun, 07 Nov 2010 09:59:07 -0500
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
You need to set the base_url config.py variable:

py["base_url"] = "http://localhost"

http://pyblosxom.bluesock.org/1.5/config_variables.html#base-url


On 11/07/2010 09:54 AM, Dieter Plaetinck wrote:
> I've now hardcoded my baseurl:
> 
> $ grep base_url /srv/http/dieterblog/config.py
> base_url = "http://localhost"
> 
> However this does not solve the problem.
> Like before, I tried disabling all plugins (and restarting lighty), to
> no avail. My entire blog source code can be found at
> https://github.com/Dieterbe/dieterblog
> 
> Dieter
> 
> On Tue, 2 Nov 2010 14:58:17 +0100
> Dieter Plaetinck <dieter-7FYLOmueu/[email protected]> wrote:
> 
>> I use a fastcgi wsgi script, ran by Lighttpd.
>> The script and the lighty config are in my previous mail, not sure
>> what else you want to know?
>> So if I understand what you're saying, the SCRIPT_NAME in the
>> environment is incorrect.
>>
>> I think I might be hitting the following issue:
>> http://redmine.lighttpd.net/issues/729
>>
>> Dieter
>>
>>
>> On Tue, 02 Nov 2010 09:50:14 -0400
>> will kahn-greene <[email protected]> wrote:
>>
>>> SCRIPT_NAME is an environment variable that comes from whatever
>>> environment you're running PyBlosxom in.  It shouldn't be the full
>>> path--it should be the path from which the script was executed.
>>> It's a pretty standard CGI variable.
>>>
>>> How does your environment build the SCRIPT_NAME variable?
>>>
>>> Regardless, the documentation encourages you to set the base_url in
>>> your config.py file if it's not getting generated correctly for your
>>> situation.  I set it in my config.py file because I use mod_rewrite
>>> for url rewriting.
>>>
>>> /will
>>>
>>>
>>> On 11/02/2010 09:25 AM, Dieter Plaetinck wrote:
>>>> Hi,
>>>> I'm using the latest 1.5 code from git
>>>>
>>>> my flavours/html.flav/head contains:
>>>>
>>>> <a href="$(base_url)/">$(blog_title)</a>
>>>>
>>>> When I go to http://localhost/ this works fine: I see my blog with
>>>> all entries, but then, I click a link to see an individual entry,
>>>> say http://localhost/back_from_canada_archcon.html
>>>>
>>>> this page shows fine, i see the entry i wanted to see,
>>>> but the $base_url is now the current page +'/', so the link to
>>>> take me home points to
>>>> http://localhost/back_from_canada_archcon.html/ which, btw, shows
>>>> the home page So I can go to
>>>> http://localhost/back_from_canada_archcon.html/, and click on any
>>>> entry to see it, say:
>>>> http://localhost/back_from_canada_archcon.html/arch_linux_interview_and_uzbl_article.html
>>>> when I'm there, the $base_url is again
>>>> http://localhost/back_from_canada_archcon.html/
>>>>
>>>> To be sure, i disabled all plugins (and restarted the webserver)
>>>> but the issue stays the same.
>>>>
>>>>
>>>> Another thing, which is probably related: if i have enabled the
>>>> tags plugin (took the latest one from git)
>>>> and I am at http://localhost, then click on a tag-link, say:
>>>> http://localhost/tag/foss
>>>> it says:
>>>> "The page you are looking for is not available
>>>> Somehow I cannot find the page you want." and $base_url is now
>>>> http://localhost/tag/
>>>>
>>>> I know I can define $base_url in config.py, but I don't see why
>>>> that should be needed, since my webserver does not do anything
>>>> fancy like url rewriting, pyblosxom should be able to get the
>>>> correct base_url by itself right?
>>>>
>>>> so I checked the code, more specifically class PyBlosxom ,
>>>> function initialize(), where I see SCRIPT_NAME from the http
>>>> environment is stored in the base_url.
>>>>
>>>> And SCRIPT_NAME, when visiting
>>>> http://localhost/back_from_canada_archcon.html
>>>> is:
>>>> /back_from_canada_archcon.html/
>>>>
>>>> Is this normal? I couldn't immediately figure out what the
>>>> SCRIPT_NAME is supposed to be. Is this a bug with my webserver or
>>>> my setup? (I use lighttpd 1.4.28, my config is at
>>>> http://sprunge.us/JCCO, the fastcgi script is at
>>>> http://github.com/Dieterbe/dieterblog/blob/manageable/fcgi.py)
>>>>
>>>> Thanks,
>>>> Dieter

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev