与XAMPP上的VirtualHost上的链接无效



我正在尝试在我的计算机上为WordPress Project设置虚拟霍斯特

我将其添加到apache中的http-vhosts.conf

<VirtualHost *:80>
DocumentRoot "C:xampphtdocswordpresstest"
ServerName myapplication.dev
<Directory "C:xampphtdocswordpresstest">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
</Directory>
</VirtualHost>

我将此行添加到Windows Hosts文件

127.0.0.1             myapplication.dev

我在wp-config

中添加了这些行
define('WP_HOME','http://myapplication.dev');
define('WP_SITEURL','http://myapplication.dev');

我还添加了一个插件,以允许在WordPress上进行相对URL

但是,当我访问http://myapplication.dev时,我的网站的第一页就在那里,但是没有任何链接可用!他们都发送500错误页面

好吧,要找到解决方案,这要感谢此链接:https://gist.github.com/justthomas/141ebe0764d431888888d4f2

我更改了我的.htaccess文件

之前:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpressTest/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpressTest/index.php [L]
</IfModule>
# END WordPress

之后:

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)(.*.php)$ $2 [L]
RewriteRule . index.php [L]

最新更新