重定向/重写

问题描述

我正在尝试在共享主机上托管Directus,但我无法使其正常工作。 我想在子域中设置它,并将子域的根设置为Directus的根。然后,我将.htaccess文件放入具有以下内容的根文件夹中:

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine on
    RedirectMatch ^/$ /public/
</IfModule>

因此,当我打开cms.domain.com时,我将重定向到cms.domain.com/public。在我可以完全访问的本地计算机上,此方法有效,但是在托管服务器上,重定向到cms.domain.com/public时,我得到404。 导航到不带此.htaccess的cms.domain.com/public时,出现500个内部服务器错误,同样,在具有完全相同配置的本地计算机上也不会发生此错误

在公共文件夹中是另一个.htaccess文件(来自Directus本身),其内容如下:

# Comment this line if you are getting: "Option SymLinksIfOwnerMatch not allowed here" error in Apache
Options +SymLinksIfOwnerMatch

# PHP5_module automatically handles HTTP_AUTHORIZATION headers,but fcgi_module does not.
<IfModule mod_setenvif.c>
    <IfModule mod_proxy_fcgi.c>
        SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
    </IfModule>
</IfModule>

<ifModule mod_rewrite.c>
    RewriteEngine On

    # Map all admin endpoints to the admin app (except static files)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^admin/(.*)   admin/index.html [NC,L]

    # Map all other requests to invoke the API router (except static files)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule !^admin index.PHP?%{QUERY_STRING} [L]
</ifModule>

# Uncomment the following lines to modify PHP settings. The lines below can be used to increase the max upload size of files in Directus
#<IfModule mod_PHP7.c>
  #PHP_value upload_max_filesize 50M
  #PHP_value post_max_size 100M
#</IfModule>

感谢您的帮助,谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...