Domain specific 404 pages

Permalink Browser Info Environment
Hi

What do you recommend for Page_not_found 404 pages when working with this addon? Should the page be in the absolute root with the attribute "Allow From All Domains" , or under the domain page tree which means duplication but the themes carry across?

cheers

Type: Discussion
Status: Resolved
boonier
View Replies:
boonier replied on at Permalink Reply
boonier
Hi, I don't mean to come across as pushy :-) but I'd really appreciate some insight into this as I have to launch a site in the next day.

I have an overridden /page_not_found single page and it is using the theme I want set in the site_theme_paths.php. The override is in /single_pages/page_not_found.php. (I've been reading about setting this override in the theme folder, but I've not had any success with this for some reason)

Aside - the issues I'm having are:

a) showing the page not found view in context of the site it is called from. I'm using hooks in the pages to style the 'different sites' from the same stylesheet, but with styles specific to them (i.e <body class="brad"> or <body class="alf">) but because the route to the page not found template is from the context of root(/) not the sub page I've mapped in the add-on.

b) further to the above, I like to list the site map in this page - I'd like to programmatically assign the page id for the autonav add-on - but I'm not seeing any reliable method to pass this as a parameter to this page when it renders;

I'm sure that I'm overthinking this and it must be simple. How do others do this?

Many thanks
Si
Mainio replied on at Permalink Reply
Mainio
Hi,

Here's a good reference on how to set theme specific 404 pages:
http://c5hub.com/learning/custom-theme-specific-single-pages-login-...

If you do that in your /config/site_post.php (there normally isn't such file but you can create it), you can detect also in that file which site is being in question for that request. For further assistance, please see the documenation e.g. on setting site-specific tracking codes.

For the sitemap, I'm afraid there isn't any out-of-the-box solution for that. That requires some custom coding. You can check e.g. reference from our documentation or the auto-nav block. Or you can hire us to do it but honestly it would have to wait some time since we're super busy at the moment.

Antti / Mainio
boonier replied on at Permalink Reply
boonier
Hi there

Appreciate the reply. I've actually seen that tute before, for some reason putting the override file in my theme folder doesn't work....only in /single_pages does it override. The issue I have is that I'm using one theme between the two sites - there is a lot of commonality between both so it makes sense not to duplicate the theme. I guess that the trade off is that it could be less flexible, such as in cases like this.

Is there a way to pass values to the controller that triggers the page_not_found page to display, when it gets a 404 response from the server? If it knew from which location (cID) it was triggered, then I could pass that into the page and do a whole bunch of stuff. That would be good.

I feel at this point I am splitting hairs and just making a generic 404 page look good will suffice - it will have a link back to the respective site home pages.

Thanks again
Si
Mainio replied on at Permalink Reply
Mainio
OK, if you have the override in your /single_pages, then yes, I don't think that the theme overrides work in that case. (not 100% sure though)

I don't think you can get any cID in the 404 page because obviously it does not have a cID if the page is not found.

What you can do instead is follow my suggestion above about getting the multiple domains mapping object and then deciding what you can do. And if you want, you can also get the domain's home page object from the mapping object. Please search "domain-specific" from the MD docs.

concrete5 Environment Information

# concrete5 Version
5.6.3.3

# concrete5 Packages
Add Multiple Pages (2.1.1), Custom Contact Form - Basic (2.0), Database Case Sensitivity Migration (1.1.2), Designer Content (3.1.1), Extreme Clean (1.0), Form Tableless Layout (1.2.1), Maintenance Editor (1.2.2), Manual Nav (1.3), Multiple Domains (1.4.7), Page Redirect (1.4), Page Selector Attribute (1.1), PHP block by ND (1.0).

# concrete5 Overrides
blocks/search, blocks/autonav, blocks/stack_slider, blocks/html, blocks/feature_box, blocks/stack_grid, blocks/content, blocks/accordion, blocks/stack_slider_item, blocks/google_map, blocks/text_image_ext, blocks/sidebar_block_one, blocks/manual_nav, blocks/responsive_video, blocks/multiple_domains_autonav, blocks/tags, blocks/form, blocks/image, blocks/file, blocks/page_list, blocks/feature_box_ext, blocks/date_nav, blocks/layout_two_column, blocks/text_image, elements/tracking.php, helpers/navigation.php, libraries/view.php, libraries/request.php, libraries/page_cache, single_pages/page_not_found.php, themes/basesite_v2.1

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - Off
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
5.6.3

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mysql, mysqli, mysqlnd, odbc, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_pgsql, Phar, posix, pspell, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zlib.

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
sql.safe_mode - Off
upload_max_filesize - 2M
ldap.max_links - Unlimited
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.