librelist archives

« back to archive

Adding WWW subdomain to static assets

Adding WWW subdomain to static assets

From:
chrickso
Date:
2012-06-26 @ 13:51
Hi,

My url_for('static', filename='main.css') is outputting
http://mydomain.com/main.css

I have a domain forward set up to push http://mydomain.com to
www.mydomain.com, therefore my .css never loads and the host dies in a
redirect loop.

How can I append www to my static url? url_for('static',
filename='main.css', subdomain='www') doesn't work...

Thanks!
- chrickso

Re: Adding WWW subdomain to static assets

From:
chrickso
Date:
2012-06-28 @ 10:42
by using this method

http://flask.pocoo.org/mailinglist/archive/2011/8/25/static-files-subdomains/#be78a466ea8ec18d64d32911df4d29eb

i was able to add subdomain='www' to my app.add_url_rule and everything
works great now.

thanks for the help!

- chrickso

On Tue, Jun 26, 2012 at 8:51 AM, chrickso <chrickso@gmail.com> wrote:

> Hi,
>
> My url_for('static', filename='main.css') is outputting
> http://mydomain.com/main.css
>
> I have a domain forward set up to push http://mydomain.com to
> www.mydomain.com, therefore my .css never loads and the host dies in a
> redirect loop.
>
> How can I append www to my static url? url_for('static',
> filename='main.css', subdomain='www') doesn't work...
>
> Thanks!
> - chrickso
>

[Flask] Adding WWW subdomain to static assets

From:
chrickso
Date:
2012-06-26 @ 14:09
Hi,

My url_for('static', filename='main.css') is outputting
http://mydomain.com/main.css

I have a domain forward set up to push http://mydomain.com to
www.mydomain.com, therefore my .css never loads and the host dies in a
redirect loop.

How can I append www to my static url? url_for('static',
filename='main.css', subdomain='www') doesn't work...

Thanks!

- chrickso

Re: [flask] [Flask] Adding WWW subdomain to static assets

From:
Jonathan Chen
Date:
2012-06-26 @ 15:14
I think if you put the following:

url_for('static', filename='main.css', _external=True)

If you do this then you can get the full absolute name of the system.

~Jonathan C.


On Tue, Jun 26, 2012 at 7:09 AM, chrickso <chrickso@gmail.com> wrote:

> Hi,
>
> My url_for('static', filename='main.css') is outputting
> http://mydomain.com/main.css
>
> I have a domain forward set up to push http://mydomain.com to
> www.mydomain.com, therefore my .css never loads and the host dies in a
> redirect loop.
>
> How can I append www to my static url? url_for('static',
> filename='main.css', subdomain='www') doesn't work...
>
> Thanks!
>
> - chrickso
>

Re: [flask] [Flask] Adding WWW subdomain to static assets

From:
chrickso
Date:
2012-06-27 @ 11:30
this does not work.

there is no distinguishable difference in the static url when i add
_external=True

Thanks anyways.



On Tue, Jun 26, 2012 at 10:14 AM, Jonathan Chen <tamasiaina@gmail.com>wrote:

> I think if you put the following:
>
> url_for('static', filename='main.css', _external=True)
>
> If you do this then you can get the full absolute name of the system.
>
> ~Jonathan C.
>
>
>
> On Tue, Jun 26, 2012 at 7:09 AM, chrickso <chrickso@gmail.com> wrote:
>
>> Hi,
>>
>> My url_for('static', filename='main.css') is outputting
>> http://mydomain.com/main.css
>>
>> I have a domain forward set up to push http://mydomain.com to
>> www.mydomain.com, therefore my .css never loads and the host dies in a
>> redirect loop.
>>
>> How can I append www to my static url? url_for('static',
>> filename='main.css', subdomain='www') doesn't work...
>>
>> Thanks!
>>
>> - chrickso
>>
>
>

unsubscribe

From:
Gardner
Date:
2012-06-26 @ 14:23

      
    

Re: [flask] Adding WWW subdomain to static assets

From:
Juancarlo Añez
Date:
2012-06-27 @ 22:52
Isn't something different from Flask at work there?

I would expect the output to be "/static/main.css", or "/main.css" if you
changed the location of static files.

If you did change the location of static files in Flask, What did you
change it to?

-- Juancarlo

On Tue, Jun 26, 2012 at 9:21 AM, chrickso <chrickso@gmail.com> wrote:

> My url_for('static', filename='main.css') is outputting
> http://mydomain.com/main.css
>
> I have a domain forward set up to push http://mydomain.com to
> www.mydomain.com, therefore my .css never loads and the host dies in a
> redirect loop.
>
> How can I append www to my static url? url_for('static',
> filename='main.css', subdomain='www') doesn't work...
>



-- 
Juancarlo *Añez*

Re: [flask] Adding WWW subdomain to static assets

From:
azwar akbar
Date:
2012-06-27 @ 23:40
Hi sometimes www and without www also happen when we transfer domain. With
same index page for www.example.com and example.com sometimes it is
different.

Here is real eample:
try access this http://rumahaktifitas.org/ and this
http://www.rumahaktifitas.org/

Just for suggestion, have you check this issue? Is this issue also happen
to you when accessing index/root url?

-- 


regards,
Azwar Akbar