typo3-realurl icon indicating copy to clipboard operation
typo3-realurl copied to clipboard

fileName for Types doesnt work

Open axsc opened this issue 8 years ago • 13 comments

I have a similar problem with Typo3 7.6.9 and realURL 2.0.14 as described in #60.

The url /?type=841132 works. The url /sitemap.xml only works if i am logged in in the backend otherwise i get "page does not exist".

My realURL configuration:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
    'fileName' => array (
        'index' => array(
            'robots.txt' => array(
                'keyValues' => array(
                    'type' => 841231
                ),
            ),
            'sitemap.xml' => array(
                'keyValues' => array(
                    'type' => 841132,
                    'page' => 1
                ),
            ),
        ),
    ),
);

Please recheck this problem.

axsc avatar Jun 14 '16 14:06 axsc

Please, fix your configuration first. That page parameter does not exist in TYPO3.

dmitryd avatar Jun 14 '16 14:06 dmitryd

Hi,

thank you for your fast response. I hope, that you receive this message and can reopen this issue again.

Nevertheless this parameter is outdated, it changes the generated urls. e.g. metaseo generates the url "/sitemap.xml" if i set the parameter "page" and without the parameter i get "/sitemap.xml?page=1".

So i started with a clean realURL configuration and then "played around". But it does not work with or without the "page" parameter.

What i do not understand is, that it works when i am logged in in the backend.

axsc avatar Jun 14 '16 15:06 axsc

I'll see if I can reproduce it.

dmitryd avatar Jun 14 '16 15:06 dmitryd

Additionally i found out, that it always works if i use a subpage. e.g. /menu_1/sitemap.xml.

Only /sitemap.xml produces the following error:

#1301648781: The requested page does not exist! (More information)
TYPO3\CMS\Core\Error\Http\PageNotFoundException thrown in file
/typo3_src-7.6.9/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php in line 1598.

axsc avatar Jun 24 '16 07:06 axsc

It has somthing todo with the doktype "spacer".

I used a spacer to divide two menu areas below the frontpage (id=1). After i have deactivated the spacer http://domain/sitemap.xml works.

axsc avatar Jun 27 '16 14:06 axsc

Hi, I also got this error after updating RealURL from 2.0.1 to 2.0.14. But when I removed previous realurl_autoconf.php it works perfectly. and if I add typo3conf/realurl_conf.php file without remove the realurl_autoconf.php it works. Unfortunately, I don't have anything on typo3conf/realurl_conf.php, it is an empty file. but I have something in my realurl_autoconf.php.

<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=unserialize('a:1:{s:8:"_DEFAULT";a:3:{s:4:"init";a:6:{s:16:"enableCHashCache";b:1;s:18:"appendMissingSlash";s:18:"ifNotFile,redirect";s:18:"adminJumpToBackend";b:1;s:20:"enableUrlDecodeCache";b:1;s:20:"enableUrlEncodeCache";b:1;s:19:"emptyUrlReturnValue";s:1:"/";}s:8:"pagePath";a:5:{s:4:"type";s:4:"user";s:8:"userFunc";s:68:"EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main";s:14:"spaceCharacter";s:1:"-";s:14:"languageGetVar";s:1:"L";s:11:"rootpage_id";s:1:"1";}s:8:"fileName";a:3:{s:25:"defaultToHTMLsuffixOnPrev";i:0;s:16:"acceptHTMLsuffix";i:1;s:5:"index";a:1:{s:5:"print";a:1:{s:9:"keyValues";a:1:{s:4:"type";i:98;}}}}}}');

My extension's realurl configuration is that

    /**
     * Register realurl pagetype for sitemap
     */
    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']['fileName']['index']['sitemap.xml'] = array (
        'keyValues' => array (
            'type' => '2000',
        )
    );

Might be this will help you to reproduce the error or others who have the same issue.

midhundevasia avatar Jul 21 '16 18:07 midhundevasia

@midhundevasia

realurl_autoconf.php is a file that realurl generates if no manual configuration is present. If you put an empty realurl_conf.php, you disable automatic config but leave realurl without config at all. This is quite strange thing to do. It is like driving to an unknown place without a map or GPS navigation: may be you will come there or may be not.

Realurl is not the piece of software that you can run without proper configuration.

Your second code fragment should be in realurl_conf.php.

dmitryd avatar Jul 21 '16 21:07 dmitryd

I still cannot confirm the issue. Since there is no new data, I close it.

dmitryd avatar Sep 15 '16 11:09 dmitryd

I cannot reproduce this issue anymore. Maybe the update to 2.0.15 fixed it. I am not sure.

axsc avatar Sep 15 '16 12:09 axsc

Hello Dmitry, I know this issue is closed - but anyway - I thought it's better to not open another new issues for a very similar problem:


First my environment:


Then try these steps to reproduce the problem. (in the exact order)

  1. delete realurl_autoconf.php
  2. truncate tx_realurl_urldata database table
  3. frontend request project.vm/?type=9201 which returns the proper content for robots.txt
  4. frontend request project.vm/robots.txt which returns Reason: Segment "robots.txt" was not a keyword for a postVarSet as expected on page with id=1.
  5. now I add <f:link.page pageType="9201" >Foo</f:link.page> to the fluid template for the page with typeNum 9201
  6. frontend request project.vm/?type=9201 renders the link now to project.vm/robots.txt
  7. voilà, another frontend request project.vm/robots.txt now renders the correct page with typeNum 9201.

I then noticed that a proper entry in tx_realurl_urldata was added for typeNum 9201 after rendering of the f:link.page viewhelper / fluid template was finished: image

I hope this helps finding the reason for the problem.

josefglatz avatar Oct 14 '16 06:10 josefglatz

Okay, now it better describes the issue. It seems that this does not work until the url with the filename gets to the cache. This is something I can test. Thank you.

Reopening.

dmitryd avatar Oct 15 '16 17:10 dmitryd

Still cannot reproduce it :( Tried with cleared url data and configuration like yours.

dmitryd avatar Oct 31 '16 12:10 dmitryd

@dmitryd hmm, did you have tested it with the same environment as I? The generated realurl_autoconf.php looks like mine? Anyway, I will test it once more in the evening today!

josefglatz avatar Nov 02 '16 07:11 josefglatz