Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

If I Use Http:// Only Site Works, If I Use Www. Site Does Not


Best Answer chris@videomi.com , 23 August 2014 - 09:37 PM

I was able to fix this. It's a cross domain issue involving json/ajax calls that's easily fixed (in our case at least) with a simple addition to our .htaccess file.

 

Link below has the fixes that worked for us.

 

http://www.webdevdoo...wser-json-ajax/

 

For us it was as simple as adding this code to our .htaccess:

 

<IfModule mod_headers.c>
   Header add Access-Control-Allow-Origin: *
</IfModule>
 
This has some security holes but our site is only a temporary site for a client to view some videos. There are .htaccess
fixeses in the link that work as well as well as some code fixes that are way over my head.
 
There are a bunch of suggested fixes on the web that DON'T fix this, such as the common suggestion to use a permanent 301 redirect). On our server it resulted in a loop error...and our server worked fine using www. http or no prefix at all on all other pages. So this appears to be something specific in how tubepress calls things. Our page would load fine, but thumbnails would be unresponsive based on whichever site URL was NOT specified in the tubepress php file. So if I specified http://mysite.com, the site loaded but didn't work correctly if you visited using www. If I specified www.mysite.com, the site didn't work correctly if you visited WITHOUT using the www.
 
Again...the site loaded and displayed fine regardless, but thumbmails were unresponsive. So it doesn't really appear to be a classic cross-domain problem but more of a problem making json/ajax calls.
Go to the full post


  • Please log in to reply
1 reply to this topic

#1 chris@videomi.com

chris@videomi.com

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 23 August 2014 - 06:23 PM

My site works great if I visit without using the www. prefix. However, if I use www. in any form to reach the site, only the first loaded video plays. If a user clicks the thumbnails, they are unresponsive.

 

If we visit the site by using just http:// and the name (without www.).... or by just typing the name without either http:// or www. the site also works.

 

Any help here is appreciated. I'm not sure I've ever seen a site not work based on the prefix that's typed in!

 

The site is videomi.com/tubepress. So to review, the site works if we type in:

 

http://videomi.com/tubepress ....or if we type videomi.com/tubepress

 

The site does NOT work if we type in http://www.videomi.com/tubepress ...or www.videomi.com/tubepress

 

 

Thanks

 

Chris Blair

 



#2 chris@videomi.com

chris@videomi.com

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 23 August 2014 - 09:37 PM   Best Answer

I was able to fix this. It's a cross domain issue involving json/ajax calls that's easily fixed (in our case at least) with a simple addition to our .htaccess file.

 

Link below has the fixes that worked for us.

 

http://www.webdevdoo...wser-json-ajax/

 

For us it was as simple as adding this code to our .htaccess:

 

<IfModule mod_headers.c>
   Header add Access-Control-Allow-Origin: *
</IfModule>
 
This has some security holes but our site is only a temporary site for a client to view some videos. There are .htaccess
fixeses in the link that work as well as well as some code fixes that are way over my head.
 
There are a bunch of suggested fixes on the web that DON'T fix this, such as the common suggestion to use a permanent 301 redirect). On our server it resulted in a loop error...and our server worked fine using www. http or no prefix at all on all other pages. So this appears to be something specific in how tubepress calls things. Our page would load fine, but thumbnails would be unresponsive based on whichever site URL was NOT specified in the tubepress php file. So if I specified http://mysite.com, the site loaded but didn't work correctly if you visited using www. If I specified www.mysite.com, the site didn't work correctly if you visited WITHOUT using the www.
 
Again...the site loaded and displayed fine regardless, but thumbmails were unresponsive. So it doesn't really appear to be a classic cross-domain problem but more of a problem making json/ajax calls.