AMH 社区首页
AMH社区 - 开放自由有价值的社区
[求助帖] owncloud apache下重写规则怎么写 |
|
---|---|
michaelzeng |
michaelzeng 发表于 2015-12-24 18:00:12
面板自带的owncloud版本低了,想装最新版。安装完成后访问提示,“Access denied.” 应该是重写规则不对。论坛里貌似只有nginx用的规则,哪位大神能提供个apache用的规则么?
先谢过啦 支持
点赞,加油! (0分)
2015-12-24 18:00:12 1
|
dongshan8 |
楼主您好,
为您从ownCloud官方下载8.2.2安装包,里边有一个.htaccess的文件,复制它的内容,看是不是有您想要的: # Version: 8.2.2
<IfModule mod_headers.c> <IfModule mod_fcgid.c> <IfModule mod_setenvif.c> SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1 RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION </IfModule> </IfModule> <IfModule mod_env.c> # Add security and privacy related headers Header set X-Content-Type-Options "nosniff" Header set X-XSS-Protection "1; mode=block" Header set X-Robots-Tag "none" Header set X-Frame-Options "SAMEORIGIN" SetEnv modHeadersAvailable true </IfModule> # Add cache control for CSS and JS files <FilesMatch "\.(css|js)[ DISCUZ_CODE_0 ]quot;> Header set Cache-Control "max-age=7200, public" </FilesMatch> </IfModule> <IfModule mod_php5.c> php_value upload_max_filesize 513M php_value post_max_size 513M php_value memory_limit 512M php_value mbstring.func_overload 0 php_value always_populate_raw_post_data -1 php_value default_charset 'UTF-8' php_value output_buffering 0 <IfModule mod_env.c> SetEnv htaccessWorking true </IfModule> </IfModule> <IfModule mod_rewrite.c> RewriteEngine on RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L] RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L] RewriteRule ^\.well-known/carddav /remote.php/carddav/ [R=301,L] RewriteRule ^\.well-known/caldav /remote.php/caldav/ [R=301,L] RewriteRule ^apps/calendar/caldav\.php remote.php/caldav/ [QSA,L] RewriteRule ^apps/contacts/carddav\.php remote.php/carddav/ [QSA,L] RewriteRule ^remote/(.*) remote.php [QSA,L] RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L] RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L] </IfModule> <IfModule mod_mime.c> AddType image/svg+xml svg svgz AddEncoding gzip svgz </IfModule> <IfModule mod_dir.c> DirectoryIndex index.php index.html </IfModule> AddDefaultCharset utf-8 Options -Indexes <IfModule pagespeed_module> ModPagespeed Off </IfModule>
回复
2015-12-24 21:09:24 2
|
michaelzeng |
非常感谢你的帮助。我刚试了试,不过仍然提示我Access denied. 支持
回复
2015-12-24 21:40:57 3
|
michaelzeng |
大神~我突然想到一个东西。这个owncloud是不是需要安装pathinfo? 支持
回复
2015-12-24 21:44:19 4
|
Lemo阿童木 |
装了pathinfo果然可以了,好开心
回复
2016-11-01 20:22:22 5
|
eyearth |
安装了pathinfo,已经开启 还是显示Access denied. 请问大神什么情况?
回复
2017-08-23 17:45:01 6
|
eyearth |
<IfModule mod_headers.c>
<IfModule mod_setenvif.c> <IfModule mod_fcgid.c> SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1 RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION </IfModule> <IfModule mod_lsapi.c> SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1 RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION </IfModule> <IfModule mod_proxy_fcgi.c> SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1 </IfModule> </IfModule> <IfModule mod_env.c> # Add security and privacy related headers Header set X-Content-Type-Options "nosniff" Header set X-XSS-Protection "1; mode=block" Header set X-Robots-Tag "none" Header set X-Frame-Options "SAMEORIGIN" Header set X-Download-Options "noopen" Header set X-Permitted-Cross-Domain-Policies "none" SetEnv modHeadersAvailable true </IfModule> # Let browsers cache CSS, JS files for half a year <FilesMatch "\.(css|js)$"> Header set Cache-Control "max-age=15778463" </FilesMatch> # Let browsers cache WOFF files for a week <FilesMatch "\.woff$"> Header set Cache-Control "max-age=604800" </FilesMatch> </IfModule> <IfModule mod_php5.c> php_value always_populate_raw_post_data -1 php_value upload_max_filesize 513M php_value post_max_size 513M php_value memory_limit 512M php_value mbstring.func_overload 0 php_value default_charset 'UTF-8' php_value output_buffering 0 <IfModule mod_env.c> SetEnv htaccessWorking true </IfModule> </IfModule> <IfModule mod_php7.c> php_value upload_max_filesize 513M php_value post_max_size 513M php_value memory_limit 512M php_value mbstring.func_overload 0 php_value default_charset 'UTF-8' php_value output_buffering 0 <IfModule mod_env.c> SetEnv htaccessWorking true </IfModule> </IfModule> <IfModule mod_rewrite.c> RewriteEngine on RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L] RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L] RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L] RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L] RewriteRule ^remote/(.*) remote.php [QSA,L] RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L] RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.* RewriteRule ^(?:\.|autotest|occ|issue|indie|db_|console).* - [R=404,L] </IfModule> <IfModule mod_mime.c> AddType image/svg+xml svg svgz AddEncoding gzip svgz </IfModule> <IfModule mod_dir.c> DirectoryIndex index.php index.html </IfModule> AddDefaultCharset utf-8 Options -Indexes <IfModule pagespeed_module> ModPagespeed Off </IfModule> #### DO NOT CHANGE ANYTHING ABOVE THIS LINE #### ErrorDocument 403 //core/templates/403.php ErrorDocument 404 //core/templates/404.php
回复
2017-08-23 17:46:43 7
|
掘金 |
回复
2017-08-26 12:11:53 8
|
kint7669 |
这类程序根目录下都会自带一个.htaccess,那个就是apache的规则~
回复
2017-08-28 23:39:51 9
|