我剛剛上傳了我的現場magento網站,但只有主頁的作品,其他網頁顯示404錯誤。 可能是什麼問題。我已經從數據庫中更改了安全和不安全的url,並刪除了var/cache和var/session?只有主頁在新鮮的Magento上安裝
0
A
回答
0
只需將一個.htaccess
文件從工作的magento文件放入根目錄即可。這應該可以解決你的問題。
0
在您的magento根文件夾中創建一個帶有以下內容的.htaccess文件。另外,當您安裝時,您是否想要使用Apache Rewrites存在問題。根據您的回答,您可能需要轉到管理員(使用yourdomain.com/index.php/admin)。登錄,進入系統 - >配置 - > Web。將選項「使用Web服務器重寫」更改爲yes。它在「搜索引擎優化」標題下。
如果您需要直接在數據庫中執行此操作,您可以使用下面的查詢做:
UPDATE core_config_data SET `value`='1' WHERE path = "web/seo/use_rewrites";
默認.htaccess文件:
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi
# Action php5-cgi /cgi-bin/php5-cgi
# AddHandler php5-cgi .php
############################################
## GoDaddy specific options
# Options -MultiViews
## you might also need to add this line to php.ini
## cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini
############################################
## this line is specific for 1and1 hosting
#AddType x-mapp-php5 .php
#AddHandler x-mapp-php5 .php
############################################
## default index file
DirectoryIndex index.php
<IfModule mod_php5.c>
############################################
## adjust memory limit
# php_value memory_limit 64M
php_value memory_limit 256M
php_value max_execution_time 18000
############################################
## disable magic quotes for php request vars
php_flag magic_quotes_gpc off
############################################
## disable automatic session start
## before autoload was initialized
php_flag session.auto_start off
############################################
## enable resulting html compression
#php_flag zlib.output_compression on
###########################################
# disable user agent verification to not break multiple image upload
php_flag suhosin.session.cryptua off
###########################################
# turn off compatibility with PHP4 when dealing with objects
php_flag zend.ze1_compatibility_mode Off
</IfModule>
<IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image upload
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
<IfModule mod_deflate.c>
############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip
# Insert filter on all content
###SetOutputFilter DEFLATE
# Insert filter on selected content types only
#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
# Netscape 4.x has some problems...
#BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
#BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
#SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
#Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_ssl.c>
############################################
## make HTTPS env vars available for CGI mode
SSLOptions StdEnvVars
</IfModule>
<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/
############################################
## uncomment next line to enable light API calls processing
# RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]
############################################
## rewrite API2 calls to api.php (by now it is REST only)
RewriteRule ^api/rest api.php?type=rest [QSA,L]
############################################
## workaround for HTTP authorization
## in CGI environment
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]
############################################
## redirect for mobile user agents
#RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
############################################
## 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
RewriteRule .* index.php [L]
</IfModule>
############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead
AddDefaultCharset Off
#AddDefaultCharset UTF-8
<IfModule mod_expires.c>
############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
ExpiresDefault "access plus 1 year"
</IfModule>
############################################
## By default allow all access
Order allow,deny
Allow from all
###########################################
## Deny access to release notes to prevent disclosure of the installed Magento version
<Files RELEASE_NOTES.txt>
order allow,deny
deny from all
</Files>
############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags
#FileETag none
+0
謝謝espradley – Jahswey
相關問題
- 1. 硬件啓動 - 在新鮮的主板上安裝uboot
- 2. Magento主頁只在index.php上有衝突
- 3. Ubuntu上的新鮮Apache2安裝
- 4. 新鮮的Magento 2安裝只顯示HTML內容而不造型
- 5. gitlab無法新鮮安裝
- 6. SQLlite「沒有這樣的列」新鮮的錯誤只有在簽署APK安裝
- 7. PHPUnit在新鮮的Symfony 3安裝
- 8. 如何爲本地主題開發準備新鮮magento安裝(版本1.8.1)?
- 9. 新鮮OpenEMM安裝顯示某些頁面上
- 10. Laravel流明空白頁面上新鮮安裝
- 11. magento主題安裝
- 12. Google IO Twitter新鮮安裝的新鮮飼料
- 13. zeppelin:新安裝,無主頁
- 14. 克隆Magento項目到一個新鮮的Magento安裝文件夾
- 15. 如何在magento的主頁上製作只有H1的圖標
- 16. 在新鮮的Mac上安裝psd-tools時遇到的挑戰
- 17. 新鮮的WAS-CE安裝只提供「HTTP 400'錯誤請求'」?
- 18. 安裝Magento的2之後,我無法加載Magento的主頁
- 19. 對新鮮Laravel安裝的ERR_INCOMPLETE_CHUNKED_ENCODING
- 20. 複製新鮮的Drupal安裝
- 21. 新鮮安裝後的Git錯誤
- 22. 連接到新鮮的SQL Server安裝
- 23. 錯誤新鮮symfony的安裝
- 24. 如何在新鮮的ubuntu 14.04(64位)上安裝IntelliJ IDEA 13?
- 25. Eclipse PHP在新鮮的Ubuntu上安裝破解
- 26. 無法在新鮮的debian 8 jessie上安裝docker
- 27. 應用程序崩潰啓動時只有更新不新鮮安裝
- 28. 安裝在Ubuntu新鮮安裝Scrapy時出錯
- 29. 錯誤在新鮮小牛安裝自制軟件安裝
- 30. 新鮮的phpBB 3.1.3安裝後的空白頁面
到位.htaccess文件,並且是Apache(假設這就是你正在使用的)配置使用它? – Mike
我無法找到任何.htaccess那裏。我能做些什麼 – Jahswey
我覺得它隱藏起來。如何取消隱藏 – Jahswey