Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress正在重定向到xampp中的htdocs文件夹_Php_Wordpress_.htaccess - Fatal编程技术网

Php Wordpress正在重定向到xampp中的htdocs文件夹

Php Wordpress正在重定向到xampp中的htdocs文件夹,php,wordpress,.htaccess,Php,Wordpress,.htaccess,我在/blog目录下安装了wordpress。一切都很完美。今天我试着调整2-3件事情,因为它并没有出现在服务器上。我开始了解要定义的siteurl和home。但是过了一会儿,它就不工作了。我回滚了所有更改(只有3个更改),但问题仍然并没有得到解决。 因此,当我配置wordpress时,它运行在http://localhost:5000/blog。由于这个原因,选项表也有这样的功能 1 siteurl http://localhost:5000/blog yes 2 home h

我在
/blog
目录下安装了wordpress。一切都很完美。今天我试着调整2-3件事情,因为它并没有出现在服务器上。我开始了解要定义的
siteurl
home
。但是过了一会儿,它就不工作了。我回滚了所有更改(只有3个更改),但问题仍然并没有得到解决。 因此,当我配置wordpress时,它运行在
http://localhost:5000/blog
。由于这个原因,
选项
表也有这样的功能

1   siteurl http://localhost:5000/blog  yes
2   home    http://localhost:5000/blog  yes
3   blogname    Stockarea   yes
4   blogdescription Just another WordPress site yes

但是现在,当我在相同的url上运行它时,
http://localhost:5000/blog
它将我重定向到
http://localhost/blog
并给出
错误404-找不到对象。我已经把所有东西都回滚到初始状态,但仍然是这样

我甚至尝试在wp_config.php中添加这个

define( 'WP_HOME', 'http://localhost:5000' );
define( 'WP_SITEURL', 'http://localhost:5000' )

但是一点运气都没有。尝试重新启动xampp服务器,但仍然没有成功。为什么wordpress将我重定向到wordpress文件夹中的htdocs文件夹,并设置以下参数

define('WP_HOME','http://localhost:5000/blog');
define('WP_SITEURL','http://localhost:5000/blog');
请检查您的.htaccess文件,希望以下代码能解决您的问题:

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

# END WordPress
#开始WordPress
重新启动发动机
重写库/博客/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/blog/index.php[L]
#结束WordPress

打开WordPress文件夹中的wp config.php文件,然后设置站点

url(define('WP_SITEURL','http://localhost:5000/Stockarea/index.php');

文件夹名称

我们必须在哪里拥有此.htaccess文件。在/blog目录中,对吗?是,在blog目录中正确。但是,有时如果它没有显示在您的系统中,请确保您已在上选择了隐藏文件和文件夹的可见性。由于.htaccess文件的默认性质是隐藏的,因为它是站点的关键文件。是的,我知道,但是.htaccess文件是否适用于localhostYes,它适用于目录位置,重定向和永久链接更改数据库中的
wp选项中的
url
,并从管理面板中的
permalinks设置中重置
permalinks