Real URL (realurl): Unterschied zwischen den Versionen
| Zeile 86: | Zeile 86: | ||
This is managed automatically for newer realurl versions | This is managed automatically for newer realurl versions | ||
| + | |||
| + | <pre> | ||
| + | <?php | ||
| + | |||
| + | /** | ||
| + | * | ||
| + | * aeUrlTool default realurl configuration | ||
| + | * based on realurl-configuration of news.typo3.org | ||
| + | * http://news.typo3.org/about/realurl-configuration/ | ||
| + | * | ||
| + | */ | ||
| + | |||
| + | $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array ( | ||
| + | '_DEFAULT' => array ( | ||
| + | 'init' => array ( | ||
| + | 'enableCHashCache' => '1', | ||
| + | 'appendMissingSlash' => 'ifNotFile', | ||
| + | 'enableUrlDecodeCache' => '1', | ||
| + | 'enableUrlEncodeCache' => '1', | ||
| + | ), | ||
| + | 'redirects' => array ( | ||
| + | ), | ||
| + | 'preVars' => array ( | ||
| + | '0' => array ( | ||
| + | 'GETvar' => 'no_cache', | ||
| + | 'valueMap' => array ( | ||
| + | 'nc' => '1', | ||
| + | ), | ||
| + | 'noMatch' => 'bypass' | ||
| + | ), | ||
| + | '1' => array ( | ||
| + | 'GETvar' => 'L', | ||
| + | 'valueMap' => array ( | ||
| + | 'de' => '0', | ||
| + | 'en' => '1', | ||
| + | ), | ||
| + | 'noMatch' => 'bypass', | ||
| + | ), | ||
| + | '2' => array ( | ||
| + | 'GETvar' => 'lang', | ||
| + | 'valueMap' => array ( | ||
| + | 'de' => 'de', | ||
| + | 'en' => 'en', | ||
| + | ), | ||
| + | 'noMatch' => 'bypass', | ||
| + | ), | ||
| + | ), | ||
| + | 'pagePath' => array ( | ||
| + | 'type' => 'user', | ||
| + | 'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main', | ||
| + | 'spaceCharacter' => '-', | ||
| + | 'languageGetVar' => 'L', | ||
| + | 'expireDays' => '7', | ||
| + | 'rootpage_id' => '1', | ||
| + | ), | ||
| + | 'fixedPostVars' => array ( | ||
| + | ), | ||
| + | 'postVarSets' => array ( | ||
| + | '_DEFAULT' => array ( | ||
| + | 'archive' => array ( | ||
| + | '0' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[year]', | ||
| + | ), | ||
| + | '1' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[month]', | ||
| + | 'valueMap' => array ( | ||
| + | 'january' => '01', | ||
| + | 'february' => '02', | ||
| + | 'march' => '03', | ||
| + | 'april' => '04', | ||
| + | 'may' => '05', | ||
| + | 'june' => '06', | ||
| + | 'july' => '07', | ||
| + | 'august' => '08', | ||
| + | 'september' => '09', | ||
| + | 'october' => '10', | ||
| + | 'november' => '11', | ||
| + | 'december' => '12', | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | 'browse' => array ( | ||
| + | '0' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[pointer]', | ||
| + | ), | ||
| + | ), | ||
| + | 'select_category' => array ( | ||
| + | '0' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[cat]', | ||
| + | ), | ||
| + | ), | ||
| + | 'article' => array ( | ||
| + | '0' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[tt_news]', | ||
| + | 'lookUpTable' => array ( | ||
| + | 'table' => 'tt_news', | ||
| + | 'id_field' => 'uid', | ||
| + | 'alias_field' => 'title', | ||
| + | 'addWhereClause' => ' AND NOT deleted', | ||
| + | 'useUniqueCache' => '1', | ||
| + | 'useUniqueCache_conf' => array ( | ||
| + | 'strtolower' => '1', | ||
| + | 'spaceCharacter' => '-', | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | '1' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[swords]', | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | 'fileName' => array ( | ||
| + | // | ||
| + | // if you don't want .html-URLs set the following to "false" (e.g. 'defaultToHTMLsuffixOnPrev' => false,) | ||
| + | // then you get http://www.yourdomain.com/imprint/ instead of http://www.yourdomain.com/imprint.html | ||
| + | // | ||
| + | 'defaultToHTMLsuffixOnPrev' => true, | ||
| + | 'index' => array ( | ||
| + | 'rss.xml' => array ( | ||
| + | 'keyValues' => array ( | ||
| + | 'type' => '100', | ||
| + | ), | ||
| + | ), | ||
| + | 'rss091.xml' => array ( | ||
| + | 'keyValues' => array ( | ||
| + | 'type' => '101', | ||
| + | ), | ||
| + | ), | ||
| + | 'rdf.xml' => array ( | ||
| + | 'keyValues' => array ( | ||
| + | 'type' => '102', | ||
| + | ), | ||
| + | ), | ||
| + | 'atom.xml' => array ( | ||
| + | 'keyValues' => array ( | ||
| + | 'type' => '103', | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | |||
| + | ); | ||
| + | |||
| + | ?> | ||
| + | </pre> | ||
Version vom 23. Juli 2008, 20:31 Uhr
Tipps
Alte Simulatic Links von außen erhalten...
RewriteRule ([0-9]+)\.([0-9]+)\.html$ http:///index.php?id=$1&type=$2 [R=301,L]
Lange Pfade abkürzen Manchmal hat man sehr lange Pfade wenn die Navigation in Unterordnern liegt. Mit der Extension aoe_realurlpath kann man diese Teile "cutten"
Probleme lösen
- Fehlermeldung Pfad/sowieso/ not found nearest match is
- Problem bei der Konfigurationsdatei (Leerzeichen vorne, falsche id etc.)
- Stylesheets, Bilder etc. aus TypoScript Konfiguration werden nicht gefunden.
- BaseURL stimmt nicht config.baseURL = http://www.meineDomain.de/
Quickinfo
- Configure Apache
- TypoScript
config{
simulateStaticDocuments = 0
tx_realurl_enable = 1
baseURL = http://www.grauff.com/
}
- First try autoconfiguration
- If doesen't work switch off and use manual configuration or use aeurltool (or realurlsettings) (easier to configure and contains working standard configuration)
- look section tipps for better configuration
Configure Apache
RealURLs work by providing 'virtual paths' to 'virtual files'. These don't actually exist on the file-system, so you must tell Apache to let a PHP-script handle the request if it can't find the file. This way, all URLs to pages (like www.server.com/products/product1/left.html) will be 'redirected' to /index.php, which will handle the translation of the URL into GET parameters. Real files (like images, the TYPO3 backend, static html-files, etc.) will still be handled by Apache itself though.
You should put the supplied sample .htaccess file (called _.htaccess) in the root of your TYPO3-installation.
Alternatively, you could include the following lines in your httpd.conf, probably in the VirtualHost-section. Here is an example:
<VirtualHost 127.0.0.1>
DocumentRoot /var/www/typo3/dev/testsite-3/
ServerName www.test1.intra
RewriteEngine On
RewriteRule ^/typo3$ - [L]
RewriteRule ^/typo3/.*$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* /index.php
</VirtualHost>
NOTICE: USING httpd.conf is currently known not to work since t3lib_div::getIndpEnv('TYPO3_SITE_URL') is not correct. Solution remains to be found.
If you put it into a .htaccess file it has to look slightly different, basically stripping the leading slashes (“/”):
RewriteEngine On
#RewriteBase /mySubfolderIfNeeded
RewriteRule ^/typo3$ - [L]
RewriteRule ^/typo3/.*$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php
This will tell Apache that it should rewrite every URL that's not a filename, directory or symlink. It leaves everything starting with /typo3/ alone too.
Notice: For this work you need the Apache module “mod_rewrite”!
Also refer to the Appendix for extended information on mod_rewrite issues.
TS Config
config.simulateStaticDocuments = 0 config.baseURL = http://mydomain.com/ config.tx_realurl_enable = 1
localconf.php Configuration
with the variable $TYPO3_CONF_VARS['EXTCONF']['realurl']
This is managed automatically for newer realurl versions
<?php
/**
*
* aeUrlTool default realurl configuration
* based on realurl-configuration of news.typo3.org
* http://news.typo3.org/about/realurl-configuration/
*
*/
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
'_DEFAULT' => array (
'init' => array (
'enableCHashCache' => '1',
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => '1',
'enableUrlEncodeCache' => '1',
),
'redirects' => array (
),
'preVars' => array (
'0' => array (
'GETvar' => 'no_cache',
'valueMap' => array (
'nc' => '1',
),
'noMatch' => 'bypass'
),
'1' => array (
'GETvar' => 'L',
'valueMap' => array (
'de' => '0',
'en' => '1',
),
'noMatch' => 'bypass',
),
'2' => array (
'GETvar' => 'lang',
'valueMap' => array (
'de' => 'de',
'en' => 'en',
),
'noMatch' => 'bypass',
),
),
'pagePath' => array (
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '7',
'rootpage_id' => '1',
),
'fixedPostVars' => array (
),
'postVarSets' => array (
'_DEFAULT' => array (
'archive' => array (
'0' => array (
'GETvar' => 'tx_ttnews[year]',
),
'1' => array (
'GETvar' => 'tx_ttnews[month]',
'valueMap' => array (
'january' => '01',
'february' => '02',
'march' => '03',
'april' => '04',
'may' => '05',
'june' => '06',
'july' => '07',
'august' => '08',
'september' => '09',
'october' => '10',
'november' => '11',
'december' => '12',
),
),
),
'browse' => array (
'0' => array (
'GETvar' => 'tx_ttnews[pointer]',
),
),
'select_category' => array (
'0' => array (
'GETvar' => 'tx_ttnews[cat]',
),
),
'article' => array (
'0' => array (
'GETvar' => 'tx_ttnews[tt_news]',
'lookUpTable' => array (
'table' => 'tt_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => '1',
'useUniqueCache_conf' => array (
'strtolower' => '1',
'spaceCharacter' => '-',
),
),
),
'1' => array (
'GETvar' => 'tx_ttnews[swords]',
),
),
),
),
'fileName' => array (
//
// if you don't want .html-URLs set the following to "false" (e.g. 'defaultToHTMLsuffixOnPrev' => false,)
// then you get http://www.yourdomain.com/imprint/ instead of http://www.yourdomain.com/imprint.html
//
'defaultToHTMLsuffixOnPrev' => true,
'index' => array (
'rss.xml' => array (
'keyValues' => array (
'type' => '100',
),
),
'rss091.xml' => array (
'keyValues' => array (
'type' => '101',
),
),
'rdf.xml' => array (
'keyValues' => array (
'type' => '102',
),
),
'atom.xml' => array (
'keyValues' => array (
'type' => '103',
),
),
),
),
),
);
?>