I’m not 100% sure this is wordpress specific, but it’s only happening on the wordpress site, not with sites on the same account that don’t use wordpress.
I’ve got a redirect set up through cPanel, which I’ve verified has edited the .htaccess file.
The redirect should work as follows: [site.com/fur-ball]) should redirect to [site.com/event/2022-fur-ball])
What is happening is [site.com/fur-ball]) is redirecting to [site.com/fur-ball-registration]) instead.
.htaccess file is as follows:
​
RewriteOptions inherit
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName site.com
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation )
<IfModule php5_module>
</IfModule>
# END cPanel-generated php ini directives, do not edit
# php — END cPanel-generated handler, do not edit
# php — END cPanel-generated handler, do not edit
# 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
RewriteCond %{HTTP_HOST} ^site\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.site\.com$
RewriteRule ^fur\-ball$ “https\:\/\site\.com\/event\/2022\-fur\-ball\/” [R=301,L]
# php — BEGIN cPanel-generated handler, do not edit
# Set the “ea-php70” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php70 .php .php7 .phtml
</IfModule>
# php — END cPanel-generated handler, do not edit
Ideas? I’ve redirected plenty of times using this method, but this is the first time I’ve ever had this happen.
[ad_2]
If it’s redirecting to a page that you don’t have a rule for in your htaccess, then logic dictates that you have a redirect setup somewhere else in the site.
Also, you don’t need to escape RewriteRule statements.