drbvm26000 2017-10-16 20:04
浏览 228
已采纳

所有页面都重定向到主页

Hi I am having a funny issue with Wordpress runnign on XAMPP. 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:

# 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

I unfortunately can not access my admin panel.

Why is my wordpress doing this?

EDIT:

On updating my .htaccess file to the following, all of my pages get redirected to 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:

<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

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.

  • 写回答

3条回答 默认 最新

  • douyan1944 2017-10-16 20:18
    关注

    If you have WP installed in C:/xampp/htdocs/client_projects/Active/example-site.co.uk/ than change the RewriteBase accordingly:

    # 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]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持