我的Ubuntu 14.04服务器上的灯服务器上运行一个Word preSS网站。
我只是想用选项帖子名称
永久链接,而现在我的网页不再加载。
我打开了Apache服务器的的mod_rewrite
功能,重新启动它,但它仍然无法正常工作。
另外,这里是我的的.htaccess
文件:
#BEGIN字preSS
< IfModule mod_rewrite.c>
RewriteEngine叙述上
的RewriteBase /
重写规则^指数 .PHP $ - [L]
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则。的index.php [L]
< / IfModule>
#结束字preSS
注意 /字preSS
文件夹中的内容已经直接把里面的 / HTML
比方说我的网站的名称是 mywebsite.com
。
我怎样才能使它工作?
编辑:这是我的 /etc/apache2/sites-available/000-default.conf
文件
<虚拟主机*:80>
#ServerName指令设置的请求方案,主机名和端口
#服务器用来标识自己。这是在创建时使用
#重定向URL。在虚拟主机的情况下,向ServerName
#指定主机名必须出现在请求的主机是什么:头
#匹配这个虚拟主机。对于默认的虚拟主机(本文件)这
#值不是决定性的,因为它是不管用作为最后的手段主机。
#然而,必须明确设置任何进一步的虚拟主机。
#ServerName www.example.com
的ServerAdmin网站管理员@本地
的DocumentRoot的/ var / www / html等
#可用记录等级:trace8,...,TRACE1,调试,信息,通知,警告,
#错误,暴击,警报,EMERG。
#另外,也可以配置为记录级特定
#模块,例如
#LogLevel信息SSL:警告
错误日志$ {APACHE_LOG_DIR} /error.log
的CustomLog $ {APACHE_LOG_DIR} /access.log组合
#对于来自CONF可用/,这是大多数配置文件
#启用或禁用在全球范围内,有可能
#包括行只有一个特定的虚拟主机。例如
#以下行将启用此主机的CGI配置只
#后,一直与a2disconf处于关闭状态。
#INCLUDE CONF可用/服务-CGI-bin.conf
< /虚拟主机>
#VIM:语法=阿帕奇TS = 4 SW = 4 STS = 4 SR NOET
解决方案
已启用将.htaccess喜欢这里描述的? https://help.ubuntu.com/community/EnablingUseOfApacheHtaccessFiles
I have a Wordpress website running on Lamp Server on Ubuntu Server 14.04.
I just tried to use the option for Post Name
permalinks, and now my pages no longer load up.
I turned on the mod_rewrite
function of the Apache server, restarted it, but it still doesn't work.
Also, here's my .htaccess
file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Note that the content of /wordpress
folder has been put directly inside /html
Let's say the name of my website is mywebsite.com
.
How can I make it work?
EDIT: Here is my /etc/apache2/sites-available/000-default.conf
file
<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 www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# 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
解决方案
have you enabled the use of .htaccess like described here ? https://help.ubuntu.com/community/EnablingUseOfApacheHtaccessFiles