首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Apache2.4 ReWrite

Apache2.4 ReWrite
EN

Stack Overflow用户
提问于 2015-06-22 12:12:19
回答 1查看 178关注 0票数 0

我有一个用于我的SAMP服务器的UCP,Apache2.2运行得很好,但是现在我们想使用最新版本的PHP和Apache转到Ubuntu14.04上。

但是,由于站点-可用的新方法(.conf站点),为什么我们的UCP不能工作。

网址:http://ucp.classrpg.net/

问题,当您单击任何链接时,它的重定向到一个php文件,该文件已被重写为.htaccess文件中的.htaccess文件。

代码语言:javascript
运行
复制
RewriteEngine on 
# anything that contains a dot without a colon should be left alone
#RewriteRule ^[^:]*\. - [L]
# anything that contains a slash without a colon should be left alone
#RewriteRule ^[^:]*\/ - [L]
# redirect to main page
#RewriteRule ^/*$ /fooldal.php [L,QSA]
# anything else is to be treated as a title
#RewriteRule ^(.+)$ /data/$1 [L,QSA]
RewriteRule (.+).see(\?[.+?])?$ $1.php$2
RewriteRule (.+).web(\?[.+?])?$ $1.php$2

RewriteCond %{HTTP_HOST} ^(www\.)?kliens\.
RewriteRule (.*) http://ucp.classrpg.net/kliens.web [L]

AddDefaultCharset utf-8

#php_value display_errors 1

php_value upload_max_filesize 10M
php_value post_max_size 10M
php_value memory_limit 15M

AddType application/exe .lnk

Options -Indexes

ErrorDocument 404 /404.php
IndexIgnore *

<Files 403.shtml>
order allow,deny
allow from all
</Files>

<filesmatch "\.ori">
deny from all
</filesmatch>
Allow from 127.0.0.1
Allow from ::1
deny from 89.132.170.28
deny from 84.2.181.10
deny from 84.3.218.168
deny from 85.67.242.26

我的ucp.conf文件:

代码语言:javascript
运行
复制
    <VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    ServerName ucp.classrpg.net

    ServerAdmin sqpp15@gmail.com
    DocumentRoot /var/www/usercp
        ReWriteEngine On
        <Directory /var/www/usercp/>
        Options All
        AllowOverride None
        Require all granted
        </Directory>
    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-06-22 17:25:19

它无法工作,因为您的ucp.conf文件中没有启用使用ucp.conf文件。

代码语言:javascript
运行
复制
AllowOverride None

需要改为这个

代码语言:javascript
运行
复制
AllowOverride All

更改后,重新启动apache。告诉我你是怎么出来的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30979715

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档