简体   繁体   English

所有页面都重定向到主页

[英]All pages redirect to home page

Hi I am having a funny issue with Wordpress runnign on XAMPP. 嗨,我在XAMPP上遇到有关Wordpress runnign的有趣问题。 Mysteriously all of my pages including my admin page are redirecting to my home page which is hosted on: 神秘地,我的所有页面(包括管理页面)都被重定向到位于以下位置的主页:

http://localhost/client_projects/Active/example-site.co.uk

This is what my .htaccess file looks like: 这是我的.htaccess文件的样子:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /http://localhost/client_projects/Active/example-site.co.uk/index.php
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . http://localhost/client_projects/Active/example-site.co.uk [L]
</IfModule>

# END WordPress

I have also made sure that in phpmyadmin my table wp_options that siteurl and home fields are both pointing to http://localhost/client_projects/Active/example-site.co.uk 我还确保在phpmyadmin中,我的表wp_options中的siteurl和home字段都指向http://localhost/client_projects/Active/example-site.co.uk

I unfortunately can not access my admin panel. 不幸的是,我无法访问我的管理面板。

Why is my wordpress doing this? 为什么我的wordpress会这样做?

EDIT: 编辑:

On updating my .htaccess file to the following, all of my pages get redirected to localhost/dashboard : 在将我的.htaccess文件更新为以下内容时,我所有的页面都被重定向到localhost/dashboard

# 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

I have been working with Laravel and added the following to my https-vhosts.conf file: 我一直在使用Laravel,并将以下内容添加到我的https-vhosts.conf文件中:

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/php/frameworks/laravel/lsapp/public"
    ServerName lsapp.dev
</VirtualHost>

And my windows32/drivers hosts file 和我的Windows32 /驱动程序主机文件

127.0.0.1 localhost 
127.0.0.1 lsapp.dev

I am not sure if this is affecting anything, I have tried to revert the changes and it doesn't affect anything. 我不确定这是否会影响任何东西,我已尝试还原更改,但它不影响任何东西。

If you have WP installed in C:/xampp/htdocs/client_projects/Active/example-site.co.uk/ than change the RewriteBase accordingly: 如果您在C:/xampp/htdocs/client_projects/Active/example-site.co.uk/安装了WP,则可以相应地更改RewriteBase:

# BEGIN WordPress
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /client_projects/Active/example-site.co.uk/
    RewriteRule index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L]
</IfModule>
# END WordPress

The reason why all your request going to the main page it the following: 您的所有请求进入主页的原因如下:
RewriteRule . http://localhost/client_projects/Active/example-site.co.uk [L]

The last line of your .htaccess .htaccess的最后一行

RewriteRule . http://localhost/client_projects/Active/example-site.co.uk [L]

Explicitely reroutes to your home page. 显式重新路由到您的主页。

Should be something like 应该是这样的

  # BEGIN WordPress
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /client_projects/Active/example-site.co.uk/
    RewriteRule index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L]
</IfModule>
# END WordPress

Can you try please first take backup of your .htaccess file. 您可以尝试先备份.htaccess文件吗? Then delete this .htaccess file. 然后删除此.htaccess文件。 After then try to access your admin side. 之后,尝试访问您的管理员端。 But before that please also clear your browser data. 但在此之前,请同时清除浏览器数据。 After login admin side save parsmlinks so it will generate new htaccess file. 登录后,管理员方保存parsmlinks,以便它将生成新的htaccess文件。 Please refer this link : http://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-login-page-refreshing-and-redirecting-issue/ 请参考以下链接: http : //www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-login-page-refreshing-and-redirecting-issue/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM