Moved to a subdomain and tilepic issue
Hello I moved my Pawtucket2 instance to a subdomain and everything seems to be working fine except for the media viewer for images.
Old Pawtucket: https://www.hobartsynagogue.org/ca_library/pawtucket
New Pawtucket: https://collections.hobartsynagogue.org
When I view an image, it is trying to load this as an example (brings back invalid file):
However this works, where the second url uses the old url without the new subdomain
What is the best way to fix this? Is there a value in app.conf or global.conf to set?
Thanks
Comments
I ended up having to hardcode a value in /pawtucket/app/helpers/htmlFormHelpers.php line 437 :
$vs_viewer_base_url = 'https://www.hobartsynagogue.org/ca_library';
It works now. Certainly not ideal but don't want to start playing wtih the base_url variables
You should never have to do that. You might want to undo that change and either look at what the server is reporting in the
$_SERVER
global variable, or just punt and put these lines in yoursetup.php
file:define("__CA_SITE_HOSTNAME__", "collections.hobartsynagogue.org");
define("__CA_SITE_PROTOCOL__", "https");
define("__CA_URL_ROOT__", "");
Normally
setup.php
uses values in$_SERVER
to figure out these values, but perhaps something is different in the new environment.Hi Seth
Thanks for the suggestion. I tried those lines in setup.php but it is still the same issue.
The results of $_SERVER seem as expected as far as I can tell
There must be something weird about my hosting. A couple years ago you fixed something for me here https://collectiveaccess.org/support/index.php?p=/discussion/300490/ca-url-root-variable-in-your-setup-php-is-not-set-correctly#latest
and you said "Your hosting environment is returning an unexpected value for the script path in $_SERVER. I've not seen this one before. I just patched it on your server and will merge the fix into the next release."
What is the contents of $_SERVER?
PATH = /usr/local/bin:/bin:/usr/bin
HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING = gzip, deflate, br
HTTP_ACCEPT_LANGUAGE = en-au
HTTP_COOKIE = CA_collectiveaccess_ui_locale=en_US; _pk_id.1.82c7=c42a3d9b6618a0cd.1651706679.; _pk_ses.1.82c7=1; _ga=GA1.2.1494993275.1651706934; _gid=GA1.2.1494787893.1651706934; collectiveaccess=eed84614-8c8b-44b0-81b3-e5b0f7fb57db
HTTP_HOST = collection.hobartsynagogue.org
HTTP_USER_AGENT = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15
DOCUMENT_ROOT = /home/hobartsy/public_html/ca_library/pawtucket
REMOTE_ADDR = 61.68.220.146
REMOTE_PORT = 55291
SERVER_ADDR = 43.250.140.4
SERVER_NAME = collection.hobartsynagogue.org
SERVER_ADMIN = webmaster@collection.hobartsynagogue.org
SERVER_PORT = 443
REQUEST_SCHEME = https
REQUEST_URI = /
HTTPS = on
HTTP_MOD_REWRITE = On
X_SPDY = HTTP2
SSL_PROTOCOL = TLSv1.3
SSL_CIPHER = TLS_CHACHA20_POLY1305_SHA256
SSL_CIPHER_USEKEYSIZE = 256
SSL_CIPHER_ALGKEYSIZE = 256
SCRIPT_FILENAME = /home/hobartsy/public_html/ca_library/pawtucket/index.php
QUERY_STRING =
SCRIPT_URI = https://collection.hobartsynagogue.org/
SCRIPT_URL = /
SCRIPT_NAME = /index.php
SERVER_PROTOCOL = HTTP/1.1
SERVER_SOFTWARE = LiteSpeed
REQUEST_METHOD = GET
X-LSCACHE = on
PHP_SELF = /index.php
REQUEST_TIME_FLOAT = 1651797051.8686
REQUEST_TIME = 1651797051
Is this install also still accessible via the old URL?
Yes https://hobartsynagogue.org/ca_library/pawtucket/ still works, I set up the subdomain collections.hobartsynagogue.org that points to /ca_library_pawtucket
I set .htaccess for redirects to the subdomain but that was done after this problem emerged
Try flushing the cache and disabling access on the old name. I'd bet the old name is getting cached when the site is accessed via that URL.