需要Htaccess基本帮助

时间:2013-01-28 13:22:56

标签: .htaccess

我正在尝试在我的webhost上安装friendica(小时,类似于000webhost但是使用ssh)。

我正在将它安装到目录/子域名imoppen.domain.com(domain.com/imoppen)

但它说:.htaccess中的url重写无法正常工作。检查您的服务器配置。 我无法继续安装。

我认为这与目录与rewritebase部分有关,但我不知道如何修复它。

它也在php中出错,但对我来说这不是什么大问题;

 Warning: set_time_limit() has been disabled for security reasons in /home/username/public_html/imoppen/boot.php on line 290

我的第一个.htaccess(domain.com)包含:

# DO NOT REMOVE THIS LINE AND THE LINES BELOW ERRORPAGEID:yLaNyW

ErrorDocument 404 /404.html

# DO NOT REMOVE THIS LINE AND THE LINES ABOVE yLaNyW:ERRORPAGEID

RewriteBase /

我的第二个.htaccess(domain.com/installationdirectory)包含:

Options -Indexes
AddType application/x-java-archive .jar
AddType audio/ogg .oga

<FilesMatch "\.(out|log)$">
Deny from all
</FilesMatch>
SetEnv PHP_VER 5_3

<IfModule mod_rewrite.c>
  RewriteEngine on
  # Protect repository directory from browsing
  RewriteRule "(^|/)\.git" - [F]

  # Rewrite current-style URLs of the form 'index.php?q=x'.
  # Also place auth information into REMOTE_USER for sites running
  # in CGI mode.

  # If you have troubles or use VirtualDocumentRoot
  # uncomment this and set it to the path where your friendica installation is
  # i.e.:
  # Friendica url: http://some.example.com
  # RewriteBase /
  # Friendica url: http://some.example.com/friendica
  # RewriteBase /imoppen/
  #
    RewriteBase /

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]

</IfModule>

正如你所看到的,我试图使用rewritebase部分,但遗憾的是它没有用。 我的整体php版本设置为5.3

1 个答案:

答案 0 :(得分:1)

好像你正在使用小时主机(我也是)我通过设置解决了这个问题 - &gt; htaccess - &gt;允许URL重写