New answers tagged

2

RewriteCond %{HTTP_COOKIE} !.*wordpress_logged_in.*$ [NC] RewriteCond %{REQUEST_URI} ^(.*?/?)purchase.php RewriteRule . https://%{HTTP_HOST}%1/registrationurl [L,QSA] This will result in a 302 (temporary) redirect to /purchaseads//registrationurl - note the double-slash. This double-slash is passed through to the $_SERVER['REQUEST_URI'] variable that ...


0

add this line anywhere in the wp-config.php file: define('WP_SITEURL', 'http://example.com/'); It solved the problem for me.


1

I had <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> in my /etc/apache2/apache2.conf which is presumably where i was going wrong? If that is the only place where AllowOverride was defined then that would certainly be the problem. However, that would also mean that your .htaccess file was ...


1

Ok editing the default-ssl.conf as described here (or in my case /etc/apache2/sites-enabled/mysite.com-le-ssl.conf) to add auth settings to the end of the Virtual Host block works fine now. So it's now: <IfModule mod_ssl.c> <VirtualHost *:443> ServerName mysite.com ServerAlias www.mysite.com ServerAdmin webmaster@localhost ...


0

You appear to be missing some files. There should be an index.php file in that root directory for example. Try downloading a fresh copy of WordPress from http://wordpress.org/wordpress-5.6-no-content.zip and upload the files from that zip to your new server


0

You'll also need to update the URLs in the database, I run the following sql query in phpmyadmin > database > query after a migration. swap wp_ with your db table prefix if different from default, & adjust any URLs as needed: UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR ...


0

Edit your 404.php in your theme folder or add a 404.php in your child theme folder, so it contains your error message. It will not bypass WordPress, but it is the only way. However, if you want to gain some speed, you can go for a quick redirection to a static page by putting this content into the theme's 404.php: <?php if (!defined( 'ABSPATH' )) exit; ...


0

You should flush the rewrite rules from the function.php file. <?php /** * flush_rewrite_rules * Remove rewrite rules and then recreate rewrite rules. * @link https://developer.wordpress.org/reference/functions/flush_rewrite_rules/ * * flush_rewrite_rules(); Need to be removed before pushing to live. * Can be replaced before pushing to live by add_action( ...


1

RewriteRule ^stores/(.*)/$ /stores/$1-coupon-codes [R=301,NC,L] You can perhaps use a negative lookahead assertion to exclude URLs that already contain -coupon-codes from being redirected again, thus preventing a redirect-loop (which I assume is what's happening here). For example: RewriteRule ^stores/(?!.*-coupon-codes)(.+)/$ /stores/$1-coupon-codes [R=301,...


0

Put Below Code On .htaccess File , <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^stores/(.*)/$ /stores/$1-coupon-codes [R=301,NC,L] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>


Top 50 recent answers are included