[英]WordPress: The requested URL /myPost/ was not found on this server
[英]The requested URL /wordpress/ was not found on this server
我對wordpress相當陌生,我使用本教程將其安裝在系統上,一切正常,並且使wordpress正常工作,我設置了一切並關閉了系統。 當我重新啟動系統並訪問http:// localhost / wordpress /時,出現此錯誤
Not Found
The requested URL /wordpress/ was not found on this server.
Apache/2.4.18 (Ubuntu) Server at localhost Port 80
在互聯網上搜索了一段時間之后,我嘗試了許多修復方法,例如:
sudo nano /etc/apache2/apache2.conf
並更改權限,但到目前為止,對我來說,這些都不起作用。
希望你們能給予積極的回應。
apache2.conf
Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /usr/share>
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
<Directory /opt/lampp/htdocs/wordpress/>
AllowOverride All
Allow from All
</Directory>
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
1)通過在“設置”->“永久鏈接”中單擊“保存”按鈕來創建新的
單擊該字段,然后按CTRL + a以全選。 貼上.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
2)現在,需要激活mod_rewrite :
sudo a2enmod重寫
這將激活模塊或警告您該模塊已經生效。 要使這些更改生效,請重新啟動Apache:
sudo服務apache2重新啟動
現在頁面開始正常工作了...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.