For seo based this 4 url display 404 page.

Now we wants to redirect on homepage but my htaccess rule not working.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^www.sitename.com$
RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=301,L]

rewriterule http://www.sitename.com/?cat=6(.*)$ http://www.sitename.com/$1 [r=301,L]
rewriterule http://www.sitename.com/?p=1753(.*)$ http://www.sitename.com/$1 [r=301,L]
rewriterule http://www.sitename.com/?page_id=119(.*)$ http://www.sitename.com/$1 [r=301,L] 

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
  • 1
    I need money, lots and lots of it, and a black shelby 500GT – Pieter Goosen Jun 24 '16 at 9:02
  • @Pieter Goosen : whats u have says? – ravi patel Jun 24 '16 at 9:04
  • @ravipatel I think Pieter likes to know what your question is. What is the current situation? What is the desired situation? What have you tried to get there? Where are you stuck? – cjbj Jun 24 '16 at 9:10
  • @cjbj : I have added my issue please help for htacess rule. – ravi patel Jun 24 '16 at 9:19
  • I have found solution but how to make for specific page id. stackoverflow.com/questions/33530229/… – ravi patel Jun 24 '16 at 12:02

Instead of playing with .htaccess file I would recommend using WordPress "Redirection" plugin, it allows for redirection and also logs them.

  • I have test on local not working for this url which is with argument list. – ravi patel Jun 24 '16 at 9:45
  • I don't want to ask this dumb question, but have you cleared the cache after changing settings or while testing please use incognito mode, because sometimes the url might not be working due to caches in the browser and I have experienced it mostly with Chrome. – riteshsanap Jun 24 '16 at 9:48
  • this one work on simple url but argument type url on not. Like "?cat=6". First u have test with www.yoursiteurl.com/?cat=5 and redirect on homepage. – ravi patel Jun 24 '16 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.