2012-10-24 72 views
3

我建立了一個新鮮的TYPO3 4.7.5並安裝了RealURL 1.12.3。如果我主動RealURL我的網址不工作,因爲我得到這樣RealURL給我http://www.domain.com/4/鏈接

http://www.domain.com/4/ http://www.domain.com/7/

聯繫我做錯了嗎?似乎我忘記了一些東西。

我把這個在我的主模板

config { 
     baseURL = http://www.domain.com/ 
     simulateStaticDocuments = 0 
     tx_realurl_enable = 1 
} 

而且我啓用automtic配置。

儘管這樣我加入了手動配置(typo3conf/realurl_conf.php):

<?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 (
      'sitemap.xml' => 'sitemap-xml', 
     ), 
     'preVars' => array (
      '0' => array (
       'GETvar' => 'no_cache', 
       'valueMap' => array (
        'nc' => '1', 
       ), 
       'noMatch' => 'bypass' 
      ), 
      '1' => array (
       'GETvar' => 'L', 
       'valueMap' => array (
        'de' => '0', 
        'en' => '1', 
        'it' => '2', 
       ), 
       'noMatch' => 'bypass', 
      ), 
      '2' => array (
       'GETvar' => 'lang', 
       'valueMap' => array (
        'de' => 'de', 
        'en' => 'en', 
        'it' => 'it', 
       ), 
       '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', 
        ), 
       ), 

      ), 
     ), 
    ), 

); 

?> 

.htaccess看起來像

##### 
# 
# Example .htaccess file 
# 
# This file contains a collection of almost everything you will need 
# for optimising TYPO3: 
# 
# - mod_rewrite (used for SimulateStaticDocuments, RealUrl, etc.) 
# - PHP optimisation 
# 
# If you want to use it, you'll need to rename this file to '.htaccess'. 
# (To make this work you will need to adjust the 'AllowOverride' 
# directive in your Apache configuration file.) 
# 
# IMPORTANT: You may need to change this file depending on your TYPO3 
# installation! 
# 
# You should change every occurance of TYPO3root/ to the location where you 
# have your website in. For example: 
# If you have your website located at http://mysite.com/ 
# then your TYPO3root/ is just empty (remove 'TYPO3root/') 
# If you have your website located at http://mysite.com/some/path/ 
# then your TYPO3root/ is some/path/ (search and replace) 
# 
# If you have problems with this file, try using the minimal 
# mod_rewrite.htaccess which is located in the typo3_src/misc/ 
# directory of this installation. 
# 
# You can also use this configuration in your httpd.conf, but you'll have 
# to modify some lines, see the comments (search for 'httpd.conf') 
# 
# Using rewriting in your httpd.conf is much faster, btw. 
# 
# Questions about this file go to the matching Install mailing list, 
# see http://typo3.org/documentation/mailing-lists/ 
# 
#### 


### Begin: Rewrite stuff ### 

# Enable URL rewriting 
RewriteEngine On 

# To assist in debugging rewriting, you could use these lines 
# DON'T enable it for production! 
# This will only work in httpd.conf, not in .htaccess files 
#RewriteLog /var/log/apache/rewrite.log 
#RewriteLogLevel 9 

# If you use the RealUrl extension, then you'll have to enable the next line. 
# You will have to change this path if your TYPO3 installation is located 
# in a subdirectory of the website root. 
# 
# If you place this in httpd.conf, you cannot use this directive in any case! 
#RewriteBase/

# Stop rewrite processing if we are in the typo3/ directory 
# For httpd.conf, use this line instead of the next one: 
# RewriteRule ^/TYPO3root/(typo3/|t3lib/|tslib/|fileadmin/|typo3conf/|typo3temp/|uploads/|showpic\.php|favicon\.ico) - [L] 
RewriteRule ^(typo3/|t3lib/|tslib/|fileadmin/|typo3conf/|typo3temp/|uploads/|showpic\.php|favicon\.ico) - [L] 

# Redirect http://mysite/typo3 to http://mysite/typo3/index_re.php 
# and stop the rewrite processing 
# For httpd.conf, use this line instead of the next one: 
# RewriteRule ^/TYPO3root/typo3$ /TYPO3root/typo3/index.php [L] 
RewriteRule ^typo3$ typo3/index_re.php [L] 

# If the file/symlink/directory does not exist => Redirect to index.php 
# Important note: If you copy/paste this into httpd.conf instead 
# of .htaccess you will need to add '%{DOCUMENT_ROOT}' left to each 
# '%{REQUEST_FILENAME}' part. 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-l 

# Main URL rewriting. 

# If you use Windows and SimulateStaticDocuments do not work, try adding a 
# slash (/) right before 'index.php' below. 

# The example shows how to rewrite only *.html and *.pdf files to index.php 
# This may be helpful when using an extension that can generate PDF files 
# on the fly. 
# Example: RewriteRule .*\.(html|pdf)$ index.php [L] 

# For httpd.conf, use this line instead of the next one that has no '#': 
# RewriteRule .* /TYPO3root/index.php [L] 

# For use with the RealUrl extension, you might need to remove the 
# RewriteBase directive somewhere above and use this line instead of the 
# next one: 
# RewriteRule .* /index.php [L] 

RewriteRule .* index.php [L] 

### End: Rewrite stuff ### 

### Begin: PHP optimisation ### 

# All features below are left to the default if you don't change this. 
# Simply remove the comment marks if you want to use some/all of these 
# settings 

# The PHP developers recommend disabling this feature. Do that. 
# It's deprecated and is likely to be unsupported in future versions of PHP. 
#php_flag allow_call_time_pass_reference off 

# TYPO3 works fine with register_globals turned off. 
# This is highly recommended! 
#php_flag register_globals off 

# PHP may not declare the argv & argc variables (that would contain the GET 
# information). 
# TYPO3 doesn't need this, so just turn it off. 
#php_flag register_argc_argv off 

# Magic quotes for runtime-generated data (data from SQL, exec(), etc.) 
#php_flag magic_quotes_gpc off 

# Order in which PHP registers GET, POST, Cookie and Built-in variables 
#php_value variables_order GPCS 

### End: PHP optimisation ### 

### Begin: Miscellaneous ### 

# Make sure that directory listings are disabled 
#Options -Indexes 

# There is a problem with Internet Explorer and mod_gzip on Apache servers. 
# For more information, see 
# http://typo3.org/documentation/document-library/rtehtmlarea/Tutorial-79/ 
#mod_gzip_item_exclude file \.css$ 
#mod_gzip_item_exclude file \.png$ 
#mod_gzip_item_exclude file \.gif$ 
#mod_gzip_item_exclude file \.jpg$ 
#mod_gzip_item_exclude file \.jpeg$ 
#mod_gzip_item_exclude file \.js$ 

### End: Miscellaneous ### 

# Add your own rules here 
# ... 

回答

3

您需要在樹的根目錄中創建域記錄。

然後:

  1. 與自動配置它應該工作了 框在一起。

  2. ,或者如果你想手動進行,那麼你需要在realurl的conf下面添加在該文件(typo3conf/realurl.conf)的端線:

$TYPO3_CONF_VARS['EXTCONF']['realurl']['example.com'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']; 
unset($TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']); 

如果您使用manual realurl config,請再次檢查realurl擴展管理器是否爲手動配置讀取正確的文件。看看這裏: enter image description here

+0

我將我的域的域記錄添加到id = 1的元素。有多個條目與www和沒有。但這並沒有改變任何東西。我應該在哪裏放行?在'realurl_conf.php'中?或'localconf.php'? – testing

+0

在realurl_conf.php中,但如果您閱讀正確的文件,請檢查我的更新答案。 – Krystian

+0

我停用了自動配置,它工作。現在我再次激活它,它仍然工作。似乎這些設置的更新爲我做了。 – testing

1

即時我的情況我需要進入數據庫/ phpmyadmin並刪除所有緩存的真正的URL條目那裏。刪除realurl表中的所有條目後,它工作正常。