我已將端口8080上的Apache虛擬主機配置爲指向我的magento網站。在默認端口80上運行其他端口上的magento
Listen 8080
<VirtualHost 6x.2x.6x.1x:8080>
ServerAdmin [email protected]
ServerName domainname.com
ServerAlias *.domainname.com
DocumentRoot /var/www/sites/domain/
<Directory />
Options FollowSymLinks
AllowOverride all
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
<LocationMatch ".*\svn.*">
Order allow,deny
Deny from all
</LocationMatch>
</VirtualHost>
當我去的網站www.domain.com:8080的JS,CSS,IMG和其他東西都沒有加載,因爲端口未連接到鏈接
下面是一個重寫規則在Magento的.htaccess似乎並不工作:
<IfModule mod_rewrite.c>
############################################
## enable rewrites
Options +FollowSymLinks
RewriteEngine on
############################################
## you can put here your magento root folder
## path relative to web root
#RewriteBase /magento/
############################################
## workaround for HTTP authorization
## in CGI environment
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
############################################
## always send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
############################################
## never rewrite for existing files, directories and links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
############################################
## rewrite everything else to index.php
RewriteCond %{SERVER_PORT} !^8080$
RewriteRule .* http://6x.2x.6x.1x:8080/index.php [L]
</IfModule>
是重寫-MOD不同端口上運行的Magento網站的解決方案?如果是,那麼當前重寫規則中的錯誤在哪裏?
謝謝你,
Margots
Silvo謝謝你,它看起來像一個解決方案,但我現在沒有DB訪問來檢查它。一旦我做了,我會讓你知道它是如何工作的 – latvian 2010-07-09 02:48:03
@latvian:我添加了一個用php文件更改數據庫的方法,也許你會發現它有幫助。 – silvo 2010-07-10 07:03:55
謝謝西爾沃。它做了詭計。你是最棒的!:) – latvian 2010-07-11 02:09:56