Home .htaccess 301 Redirection Parameter to Wordpress?
Reply: 0

.htaccess 301 Redirection Parameter to Wordpress?

user1806
1#
user1806 Published in May 21, 2018, 11:16 am

I have migrated one of our sites from a PHP coded website to a WordPress website and I am having a problem with redirecting the old shop pages to our new shop pages.

I would like to do a 301 Redirect for this link:

http://www.example.com/products_promoDC.php?Product_Category=Corporate+Gifts

to:

http://www.example.com/product-category/corporate-gifts/

Everything I add does not work at all.

Currently I have:

# 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

# GZIP COMPRESSION
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# END GZIP COMPRESSION

Any help would be greatly appreciated!

EDIT

I have changed my .htaccess code:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} ^Product_Category=Corporate+Gifts$ [NC]
RewriteRule ^products_promoDC\.php http://www.example.com/product-category/corporate-gifts? [L,R=301]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.320256 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO