分享

写回答

发帖

[经验] GoDaddy magento伪静态规则

GoDaddy GoDaddy 4426 人阅读 | 0 人回复

发表于 2010-11-22 09:46:26 | 显示全部楼层 |阅读模式

问题描述:
GoDaddy空间magento程序地址重写问题
安装什么的都正常
只是地址重写出问题了
RewriteBase /
RewriteRule .* index.php  [L]  (官方默认的,但是肯定是不能运行的,直接500错误)

修改后 RewriteRule .* index.php?/$1 [L]
这样之后 前台能访问了  但是后台  他就又出错了

www.hao123.com  这样正常访问
www.hao123.com/index.php/admin/xxx        直接提示No input file specified.

手动在浏览器上去掉index.php/
www.hao123.com/admin/xxx    这样能访问 但是不能提交数据



解决办法: 在程序所在目录的.htaccess里添加如下代码
  1. addhandler x-httpd-php5-cgi .php5

  2. addhandler x-httpd-php5-cgi .php

  3. addhandler x-httpd-php-cgi .php4





  4. ############################################

  5. ## uncomment these lines for CGI mode

  6. ## make sure to specify the correct cgi php binary file name

  7. ## it might be /cgi-bin/php-cgi

  8. #    Action php5-cgi /cgi-bin/php5-cgi

  9. #    AddHandler php5-cgi .php

  10. ############################################

  11. ## GoDaddy specific options

  12. #   Options -MultiViews

  13. ## you might also need to add this line to php.ini

  14. ##     cgi.fix_pathinfo = 1

  15. ## if it still doesn't work, rename php.ini to php5.ini

  16. ############################################

  17. ## this line is specific for 1and1 hosting

  18. #AddType x-mapp-php5 .php

  19. #AddHandler x-mapp-php5 .php

  20. ############################################

  21. ## default index file

  22. DirectoryIndex index.php

  23. <IfModule mod_php5.c>

  24. ############################################

  25. ## adjust memory limit

  26. #    php_value memory_limit 64M

  27. php_value memory_limit 64M

  28. php_value max_execution_time 18000

  29. ############################################

  30. ## disable magic quotes for php request vars

  31. php_flag magic_quotes_gpc off

  32. ############################################

  33. ## disable automatic session start

  34. ## before autoload was initialized

  35. php_flag session.auto_start off

  36. ############################################

  37. ## enable resulting html compression

  38. #php_flag zlib.output_compression on

  39. ###########################################

  40. # disable user agent verification to not break multiple image upload

  41. php_flag suhosin.session.cryptua off

  42. ###########################################

  43. # turn off compatibility with PHP4 when dealing with objects

  44. php_flag zend.ze1_compatibility_mode Off

  45. </IfModule>

  46. <IfModule mod_security.c>

  47. ###########################################

  48. # disable POST processing to not break multiple image upload

  49. SecFilterEngine Off

  50. SecFilterScanPOST Off

  51. </IfModule>

  52. <IfModule mod_deflate.c>

  53. ############################################

  54. ## enable apache served files compression

  55. ## http://developer.yahoo.com/performance/rules.html#gzip

  56. # Insert filter on all content

  57. ###SetOutputFilter DEFLATE

  58. # Insert filter on selected content types only

  59. #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

  60. # Netscape 4.x has some problems...

  61. #BrowserMatch ^Mozilla/4 gzip-only-text/html

  62. # Netscape 4.06-4.08 have some more problems

  63. #BrowserMatch ^Mozilla/4\.0[678] no-gzip

  64. # MSIE masquerades as Netscape, but it is fine

  65. #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

  66. # Don't compress images

  67. #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

  68. # Make sure proxies don't deliver the wrong content

  69. #Header append Vary User-Agent env=!dont-vary

  70. </IfModule>

  71. <IfModule mod_ssl.c>

  72. ############################################

  73. ## make HTTPS env vars available for CGI mode

  74. SSLOptions StdEnvVars

  75. </IfModule>

  76. <IfModule mod_rewrite.c>

  77. ############################################

  78. ## enable rewrites

  79. Options +FollowSymLinks

  80. RewriteEngine on

  81. ############################################

  82. ## you can put here your magento root folder

  83. ## path relative to web root

  84. RewriteBase /

  85. ############################################

  86. ## workaround for HTTP authorization

  87. ## in CGI environment

  88. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

  89. ############################################

  90. ## always send 404 on missing files in these folders

  91. RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

  92. ############################################

  93. ## never rewrite for existing files, directories and links

  94. RewriteCond %{REQUEST_FILENAME} !-f

  95. RewriteCond %{REQUEST_FILENAME} !-d

  96. RewriteCond %{REQUEST_FILENAME} !-l

  97. ############################################

  98. ## rewrite everything else to index.php

  99. RewriteRule .* index.php [L]

  100. </IfModule>

  101. ############################################

  102. ## Prevent character encoding issues from server overrides

  103. ## If you still have problems, use the second line instead

  104. AddDefaultCharset Off

  105. #AddDefaultCharset UTF-8

  106. <IfModule mod_expires.c>

  107. ############################################

  108. ## Add default Expires header

  109. ## http://developer.yahoo.com/performance/rules.html#expires

  110. ExpiresDefault "access plus 1 year"

  111. </IfModule>

  112. ############################################

  113. ## By default allow all access

  114. Order allow,deny

  115. Allow from all

  116. ############################################

  117. ## If running in cluster environment, uncomment this

  118. ## http://developer.yahoo.com/performance/rules.html#etags

  119. #FileETag none
复制代码

更多伪静态规则参考:【总结】discuz 各版本,PHPwind以及Windows伪静态设置综合教程
原帖地址:http://bbs.idcspy.com/thread-119045-1-1.html

[ 本帖最后由 add.c 于 2010-11-22 09:49 AM 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则