Zum Inhalt springen

L=1 aus dem URL entfernen

Erstellt am 16. Juli 2013 · 1 Antwort · letzte Antwort am 17. Juli 2013

Tags: RealURL, URLs & Routing, Frage

Cremefresh76 ·

Hallo Zusammen,

ich hab ein Problem mit RealURL und hab auch nach langer Suche nicht die richtige Lösung gefunden. Ich möchte eigentlich nur den Parameter L=1 für die englische Übersetzung einer Website aus dem URL entfernen.

Ist: http://www.....com/law-firm/philosophy.html?L=1
Soll: http://www.....com/law-firm/philosophy.html

Folgende Konfiguration hab ich verwendet:

config  {
    admPanel = 0
   
    
    disablePrefixComment = 1
    index_enable = 1
    
    spamProtectEmailAddresses = ascii
    spamProtectEmailAddresses_atSubst = (at)
    baseURL = http://www.....com/
    prefixLocalAnchors = all
    simulateStaticDocuments = 0
    tx_realurl_enable = 1
 
    #removeDefaultJS = external
    #inlineStyle2TempFile = 1
 
    noScaleUp = 1
 
    meaningfulTempFilePrefix = 50
  
    #DOCType setzen auf XHTML trans
      doctype = xhtml_trans
   
  #erzeugten XHTML code bereinigen
      xhmtl_cleaning = all
  
  #standardspracheinstellungen
      linkVars = L  
      htmlTag_langKey = de_DE  
      sys_language_uid = 0
      language = de
      locale_all = de_DE
      sys_language_mode = content_fallback
      sys_language_overlay = hideNonTranslated
  
  }
 
  // Language Englisch
[globalVar = GP:L = 1]
  config.linkVars = L
  config.sys_language_uid = 1
  config.language = en
  config.locale_all = en_GB
  config.htmlTag_langKey = en_GB
[global]
<?php
//REALURL Konfiguration
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
		'init' => array(
		'enableCHashCache' => 1,
		'enableUrlDecodeCache' => 1,
		'enableUrlEncodeHash' => 1
	),
	'pagePath' => array (
		'type' => 'user',
		'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
		'segTitleFieldList' => 'nav_title,title,tx_realurl_pathsegment,alias',
		'spaceCharacter' => '-',
		'languageGetVar' => 'L',
		'expireDays' => 7,
		'rootpage_id' => 1,
	),
	'fileName' => array(
		'defaultToHTMLsuffixOnPrev' => true,
		'index' => array(
			'page.html' => array(
				'keyValues' => array(
					'type' => 1,
				),
			),
			'news-sitemap.xml' => array(  
				'keyValues' => array(  
					'type' => 200,  
				),  
			), 
			'sitemap.xml' => array(  
				'keyValues' => array(  
					'type' => 93,  
				),  
			), 
		),
	),
	// XML Sitemap tt_news
	'news_sitemap.xml' => array(
		'keyValues' => array(
		'type' => 110,
				),
			),
	'postVarSets' => array(
		'_DEFAULT' => array(
			'browse' => array( 
				array( 
					'GETvar' => 'tx_ttnews[pointer]', 
					'valueMap' => array(
						'weiter' => '1',
						'weiter' => '2',
					)
				),
			),	
			// news kategorien
			'kategorie' => array ( 
				array( 
					'GETvar' => 'tx_ttnews[cat]', 
					'lookUpTable' => array(
						'table' => 'tt_news_cat', 
						'id_field' => 'uid', 
						'alias_field' => 'title', 
						'addWhereClause' => ' AND NOT deleted', 
						'useUniqueCache' => 1, 
						'useUniqueCache_conf' => array( 
							'strtolower' => 1, 
							'spaceCharacter' => '-',    
						),
					),
				),
			),
			// news artikel
			'datum' => array(
				array(
					'GETvar' => 'tx_ttnews[year]', 
				),
				array(
					'GETvar' => 'tx_ttnews[month]', 
				),
				array(
					'GETvar' => 'tx_ttnews[day]', 
				),
				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' => '-',  
						),
					),
				),
			),	
		),
	),
);
?>
### Begin: Compression via TYPO3 ###

# Compressing resource files will save bandwidth and so improve loading speed especially for users
# with slower internet connections. TYPO3 can compress the .js and .css files for you.
# 1) Uncomment the following lines and
# 2) Set $TYPO3_CONF_VARS['BE']['compressionLevel'] = '9'

<FilesMatch "\.js\.gzip$">
	AddType "text/javascript" .gzip
</FilesMatch>
<FilesMatch "\.css\.gzip$">
	AddType "text/css" .gzip
</FilesMatch>
AddEncoding gzip .gzip

### End: Compression via TYPO3 ###


### Begin: Browser caching of ressource files ###

# Enable long browser caching for JavaScript and CSS files.

# This affects Frontend and Backend and increases performance.
# You can also add other file extensions (like gif, png, jpg), if you want them to be longer cached, too.

<FilesMatch "\.(js|css)$">
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 7 days"
</IfModule>
FileETag MTime Size
</FilesMatch>

### End: Browser caching of ressource files ###


### Begin: Settings for mod_rewrite ###

# You need rewriting, if you use a URL-Rewriting extension (RealURL, CoolUri, SimulateStatic).

<IfModule mod_rewrite.c>

# Enable URL rewriting
RewriteEngine On

# Change this path, if your TYPO3 installation is located in a subdirectory of the website root.
RewriteBase /

# Rule for versioned static files, configured through:
# - $TYPO3_CONF_VARS['BE']['versionNumberInFilename']
# - $TYPO3_CONF_VARS['FE']['versionNumberInFilename']
# IMPORTANT: This rule has to be the very first RewriteCond in order to work!
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]

# 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/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]

# Redirect http://example.com/typo3 to http://example.com/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.
# For httpd.conf, you need to prefix each '%{REQUEST_FILENAME}' with '%{DOCUMENT_ROOT}'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

# Main URL rewriting.
# For httpd.conf, use this line instead of the next one:
# RewriteRule .* /TYPO3root/index.php [L]
#RewriteRule .* index.php [L]
RewriteRule .* /index.php [L]

</IfModule>

### End: Settings for mod_rewrite ###


### Begin: PHP optimisation ###

# If you do not change the following settings, the default values will be used.

# TYPO3 works fine with register_globals turned off.
# This is highly recommended, if your web server has it turned on.
#php_flag register_globals off

### End: PHP optimisation ###



### Begin: Miscellaneous ###

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

### End: Miscellaneous ###


# Add your own rules here.
# ...

# Permanente Umleitung auf Hauptdomain
RewriteEngine On
RewriteBase /
 
### Umleitung www [start]
RewriteCond %{HTTP_HOST} !^www\....\.com$ [NC]
RewriteRule ^(.*)$ http://www.....com/$1 [R=301,L]

Würde mich wirklich sehr freuen wenn mir dabei jemand helfen könnte.

Vielen Dank schon mal!

Chrissli ·

Gegenfrage: An was möchtest du festmachen, welche Sprache angezeigt wird?

Die gängigen Methoden sind via URL Parameter L=1 o.ä. oder aber diesen Wert über realURL als www...com/de/ www...com/en/ zu mappen.
Den Wert komnplett wegfallen lassen, könntest du höchstens, wenn du z.b. die Sprache in eine Session schreibst und bei jedem Seitenaufruf den Wert von im $TSFE änderst.

Evtl. gibt es aber auch eine nette Extension die sowas für dich macht.

Sollte jemand was anderes Wissen, ich lerne auch immer wieder gerne was dazu.