How do I make ghost home page on a subdir? - ghost-blog

I am attempting to run ghost with the Ghost home page, normally displayed at /, instead displayed on the /blog subdir of my site.
I have followed the Ghost routing docs and the Ghost forum post come up with the following routes.yaml:
routes:
collections:
/blog/:
permalink: /{slug}/
template: index
taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/
After starting ghost and visiting http://localhost:2368/blog (or http://localhost:2368/blog/), the page shows:
404
Page not found
Go to the front page →
The 'Go to the front page →' is a link to the same page - /blog.
And in my logs:
[2021-01-26 17:54:58] INFO "GET /blog/" 404 88ms
How do I make ghost home page on a subdir?

I was able to solve this by:
Making config.development.json and config.production.json include /blog in the url setting. Eg: "url": "http://localhost:2368/blog",
Using the default routes.yaml file is as below - since url is /blog, everything in routes.yaml will be relative to that:
# EVERYTHING HERE IS RELATIVE TO '/blog' - see `url` in config.(environment).json
routes:
collections:
/:
permalink: /{slug}/
template: index
taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/

Related

How do I exclude archive directories from a rewrite rule OR rewrite the archive path to include a custom category?

I am struggling with a solution to my problem with a recent wordpress site transition. My old wordpress site had /blog/%category%/%postname%/ as the permalink. With the new site we have changes that to: /news/%category%/%postname%/
I then made a Rewrite Rule to redirect all existing blog posts:
RewriteRule ^blog/(.*) /news/executive-insights/$1 [R=301,L]
However, I didn't realize at the time that this also broke all archive URL paths.
Example:
https://www.example.com/blog/2022/04/29/ now redirects to a 404 page of:
https://www.example.com/news/executive-insights/2022/04/29/
1.) I either need a fancy way to exclude archive directory(2022,2021,2020, etc.) from the rewrite rule.
2.) Or I need a way to include /executive-insights/ as part of the archive URL path instead of: https://www.example.com/news/2022/04/29/
PS- Please don't tell me to update my custom permalink to include year/month/day that is not a solution.
This solved my problem:
//===========================================================
// START - Add /executive-insights/ into the archive url path
//===========================================================
function change_archive_links() {
global $wp_rewrite;
// add 'archive'
$wp_rewrite->date_structure ='news/executive-insights/%year%/%monthnum%/%day%';
}
add_action('init','change_archive_links');
//===========================================================
// END - Add /executive-insights/ into the archive url path
//===========================================================
Shout out: How can I change the WordPress archive URL pattern?

Codeception WebDriver url remove trailing slash

I'm trying to test Laravel 5.3 application. To bootstrap an application with testing config I have added index-testing.php entry point.
I have my codeception acceptance test config like this:
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: 'http://nginx/index-testing.php'
host: 'selenium'
browser: 'chrome'
- \Helper\Acceptance_selenium
And here is a piece of output of the test scenario:
Scenario --
I am on page "/"
[GET] http://nginx/index-testing.php/
I click ".apply-button"
So instead of http://nginx/index-testing.php it actually goes to http://nginx/index-testing.php/ which of course results in 404
How to I remove this trailing slash?
I found the answer!
In a test I was getting home page like this:
$I->amOnPage('/');
When I changed to this:
$I->amOnPage('');
No more trailing slash present.

Wordpress Multisite SubSites: 302 Moved Temporarily

I've recently changed the domain for Multisite website, I followed the instructions from here https://wpengine.com/support/how-to-change-a-multi-site-primary-domain/
Now, only main site(http://domain.com/) works but the other sites (e.g: http://domain.com/es/) are giving error "302 Moved Temporarily" and redirected to itself (http://domain.com/es/).
Under Network Admin > Sites > Edit(for sub site i.e: http://domain.com/es/) > Settings, Siteurl and Home is also same as the main URL rather than http://domain.com/es/. I tried to change it to http://domain.com/es/ but, opening the http://domain.com/es/ URL updates it back to http://domain.com/
in my wp-config.php file these lines are commented out
//define('WP_HOME','http://fruitionpartners.eu');
//define('WP_SITEURL','http://fruitionpartners.eu');
Is there something I am missing? Please help.

Google App Engine modules: routing second module to subdirectory

Has anyone run two different WordPress installations as separate modules inside Google App Engine?
I have the following:
/app/
- wordpress1
- wordpress2
- app.yaml
- second.yaml
- dispatch.yaml
- php.ini
Inside wordpress1 and wordpress2 are somewhat clean installations of WordPress, with some GAE helper plugins.
app.yaml contains the default module config, which redirects traffic to wordpress1 using URL handlers.
second.yaml contains the second module config (module: second) and redirects traffic to wordpress2.
In dispatch.yaml I only check for a subdir second to load the second.yaml config:
dispatch:
- url: "*/second*"
module: second
Everything is fine and dandy:
http://localhost.dev:8080 -> wordpress1/index.php
http://localhost.dev:8080/second/ -> wordpress2/index.php
But I can't seem to work out how to set the edge cases:
http://localhost.dev:8080/secondwithextra -> dispatcher error (no URL set)
http://localhost.dev:8080/second (missing trailing slash) -> same as above
I tried to add the following to second.yaml handlers:
- url: /second[^/].+/?
script: wordpress1/index.php # Reroute to `wordpress1` because not a directory match.
But that didn't really work out.
How can I make the second module accept request URI /second, /second/, /second/abc but not /secondxyz?
Having the dispatch.yaml URL glob set to */second/* breaks the slashless /second.
I think you could try to add both */second/* and /second in dispatch.yaml.

Wordpress - Error with homepage

We have an issue with our wordpress theme http://themeforest.net/item/flowerbomb-multipurpose-responsive-masonry-theme/7799116
The homepage does not appear. another page with errors appears instead.
Can I share the code of the theme and which code should I share so someone can help?
Thank you!!!!!!
Verify:
Include /etc/nginx/mime.types;
in nginx.conf (if nginx then only)
phpfpm and its php.ini configuration,
/etc/php/{version}/fpm/php.ini

Resources