Odd cookie set by WordPress installed in a sub directory - wordpress

I want to install & configure my WordPress site in /journal like:
https://example.com/journal/
After my installation, when I try to access /wp-admin, they say cookie settings haven't been configured within my browser and I fail to log in. When I hit curl:
$ curl -I localhost/journal/wp-login.php
HTTP/1.1 200 OK
Date: Tue, 13 Feb 2018 12:02:28 GMT
Server: Apache/2.4.6 (Amazon Linux 2) PHP/7.2.0
X-Powered-By: PHP/7.2.0
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Set-Cookie: wordpress_test_cookie=WP+Cookie+check; path=/journal/journal/; secure
X-Frame-Options: SAMEORIGIN
Content-Type: text/html; charset=UTF-8
I suppose the cookie path being /journal/journal/ is the reason I can't log in properly. What kind of additional configuration is needed to set my cookies properly?

Related

Is it possible to overwrite "server name" response header in traefik?

I'm setting up a new server with Traefik (version 1.7.10) for load balancing different NGINX and PHP-FPM containers.
Currently visitors see in the response header that my containers using NGINX. Where can I globaly, for all containers, overwrite the server response header to something other (like "FunnyServer") ?
With HAProxy I have done this in the past and wondering how to do this with Traefik?
Here you see the response coming from HAProxy:
cache-control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
content-type: text/html; charset=utf-8
date: Wed, 17 Apr 2019 20:20:15 GMT
expires: Thu, 19 Nov 1981 08:52:00 GMT
pragma: no-cache
server: MonkeysBananaServer <===== WITH HAPROXY!!! Traefik???
set-cookie: PHPSESSID=1234567890abcdef; path=/; domain=.xxx.xx
status: 200
x-powered-by: PHP/x.x.x
As you can see, under HAProxy I have set the response header to "MonkeysBananaServer".
For those who use version 2.0 and have the same question:
- "traefik.http.middlewares.secure-headers.headers.customresponseheaders.x-powered-by=SomeThing/9.7.2"
- "traefik.http.routers.custom_router_name.middlewares=secure-headers"
You can override the response headers:
traefik.frontend.headers.customResponseHeaders=server:FunnyServer
https://docs.traefik.io/configuration/backends/docker/#custom-headers

CloudFront ignores Cache-Control headers

CloudFront ignores my cache header and my pictures have to be picked up from the server again after a while.
~$ curl -I http://d2573vy43ojbo7.cloudfront.net/attachments/store/limit/64/3720c5574063aebc90511061b99de858740ad764c6981d2bf30ff121ada0/image.jpg
HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Length: 1645
Connection: keep-alive
Server: nginx/1.4.1
Date: Thu, 12 Feb 2015 14:37:41 GMT
Status: 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers:
Access-Control-Allow-Method:
Cache-Control: public, must-revalidate, max-age=31536000
Expires: Fri, 12 Feb 2016 14:37:41 GMT
Content-Disposition: inline; filename="image.jpg"
Last-Modified: Thu, 12 Feb 2015 14:37:41 GMT
X-Content-Type-Options: nosniff
X-Request-Id: 239b0fda-cae9-452f-9d1b-ccbf035bbf69
X-Runtime: 3.457939
X-Cache: Miss from cloudfront
Via: 1.1 6cde3c778df412041adc7610331b57bc.cloudfront.net (CloudFront)
X-Amz-Cf-Id: yicAkZYc5XpowKRFMOXDKSJKBMWZ4kq2B3vLK8Q-Py124D8lQq_1lg==
I tried to get the same file yesterday and then it was the same, after the second time i tried it was reached and served by CloudFront but not anymore. It's the same for all my images. They are cached but are removed from the cache after a couple of hours.
What's wrong? My cache behavior settings on CloudFront is set to default and it uses Origin Cache Headers.
Take a look here: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html
If an object in an edge location isn't frequently requested, CloudFront might evict the object—remove the object before its expiration date—to make room for objects that are more popular.
It means that object is not popular enough to stay in cache for a longer time. If you have enough viewers hitting this object AND this particular CloudFront location, it would have stayed in cache longer

wordpress wp e-commerce paypal setting not saving value

I have the newest wp e-coomerce plugin (Version 3.8.12.1) on my wordpress Version 3.6.1 installed
I'm just trying to change username (email address) in paypal standard settings of the store and it simply doesn't work - the address is not being updated neither with Update button for the option nor with Save changes button below all options.
Is it a bug? Or I'm doing something wrong?
I did check with Live HTTP headers and I can see the new values are captures correctly but then passed to the address which gives 302 error:
HTTP/1.0 302 Moved Temporarily
Date: Mon, 23 Sep 2013 08:04:17 GMT
Server: Apache
X-Powered-By: PHP/5.2.17
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
X-Frame-Options: SAMEORIGIN
Location: /wp-admin/options-general.php?page=wpsc-settings&tab=gateway&settings-updated=1
Content-Length: 0
Content-Type: text/html
X-Cache: MISS from proxy1
X-Cache-Lookup: MISS from proxy1:3128
Connection: keep-alive
But then on tabs which are saved correctly I get the same headers for /wp-admin/options-general.php as above so looks like this is not where the issue lies?

Firebug Shows 301 Moved Permanently

Im using yii framework with tiny mce. When I run my website in localhost it works just fine. But when I upload to the server the editor doesnt show up. when I check in Firebug, it show :
http://www.ptbm.co.id/veevou/assets/dde67fde/tiny_mce/tiny_mce_gzip.php?s=true&diskcache=true&core=t.......
then the status is 301 moved permanently
This is the request code :
// Send request
x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Msxml2.XMLHTTP') || get('Microsoft.XMLHTTP');
x.overrideMimeType && x.overrideMimeType('text/javascript');
x.open('GET', t.baseURL + '/' + s.page_name + '?' + q, !!cb);
//x.setRequestHeader('Content-Type', 'text/javascript');
x.send('');
The url correctly pointing to existing file.
Anyone have any idea how to fix this? Thanks
Apparently your server redirects to a URL without the www prefix:
$ curl -I 'http://www.ptbm.co.id/veevou/assets/dde67fde/tiny_mce/tiny_mce_gzip.php?s=true&diskcache=true&core=t'
HTTP/1.1 301 Moved Permanently
Date: Fri, 18 Nov 2011 09:14:48 GMT
Server: Apache
X-Powered-By: PHP/5.3.8
X-Pingback: http://ptbm.co.id/xmlrpc.php
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Last-Modified: Fri, 18 Nov 2011 09:14:49 GMT
Location: http://ptbm.co.id/veevou/assets/dde67fde/tiny_mce/tiny_mce_gzip.php?s=true&diskcache=true&core=t
Content-Type: text/html; charset=UTF-8
You could remove that RewriteRule, or make sure that t.baseUrl does not have any www prefix.
Without more code it is difficult to give any more exact pointers than that.

How to crawl a wordpress blog?

I write a c program to crawl blogs. It works well until it meets this blog: www.ipujia.com. I send the HTTP request:
GET http://www.ipujia.com/ HTTP/1.0
to the website and get the response as below:
HTTP/1.1 301 Moved Permanently
Date: Sun, 27 Feb 2011 13:15:26 GMT
Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5
mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_perl/2.0.4
Perl/v5.8.8
X-Powered-By: PHP/5.2.14
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Last-Modified: Sun, 27 Feb 2011 13:15:27 GMT
Location: http://http/www.ipujia.com/
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8
This is strange because I cannot get the index page following the Location. Does anyone have any ideas?
The Location field in the response contains a malformed URI.
Location: http://http/www.ipujia.com/ (notice the protocol error)
Should be
Location: http://www.ipujia.com/
Unless you are in control of the server there is little you could do here.
To solve it could you not parse the "Location" response and attempt to extract a valid URI from the it?

Resources