我想在WAMP系統上使用TYPO3,但我遇到了重寫URL的問題。 我已經安裝了具有「入門」網站的簡介包。每次我試圖通過其中的一個訪問網站: 本地主機/ TYPO3 本地主機/ TYPO3/index.php文件 本地主機/ TYPO3/index.php文件/ GET-開始國防部重寫:鏈接被重寫,但沒有找到
的網址將成爲本地主機/ TYPO3/GET-開始
這是好的,它意味着mod_rewrite已打開並正在工作。問題是我看不到網站localhost/typo3/get-started,而我有一個「找不到對象」頁面。
我在同一臺機器上同樣的問題與Symfony的1.4,但我從來沒有關心是因爲Symfony的,我可以用frontend_dev.php頁面訪問該站點(在我的生產環境中的URL重寫工作的罰款代替)。
這是TYPO3目錄下的httpd.conf條目:
Alias /typo3 "C:\workspace\typo3"
<Directory "C:\workspace\typo3">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
這是.htaccess文件(這已經是TYPO3包裏面,我還沒有修改的),我已經刪除了非相關零部件
### 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]
</IfModule>
### End: Settings for mod_rewrite ###