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.
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]
The last line of your .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. Then delete this .htaccess file. 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. Please refer this link : http://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-login-page-refreshing-and-redirecting-issue/