Hi guys !

I am using rewriting rules to redirect some URLs, but search engines crawling both URL (Rewritten and Real URLs).

For example :

Real URL : www.catchcoupons.in/storecoupon.php?cid=Flipkart

Rewritten URL : www.catchcoupons.in/coupon/Flipkart.html

Search Engines are crawling both URLs, even i want search engines to index only Rewritten URLs (http://www.catchcoupons.in/coupon/Flipkart.html)

This is happening with all the URLs...

Below are the codes that i am using on my .htaccess file :

Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteRule index.html$ index.php [NC,QSA,L]
RewriteRule allstore.html$ allstore.php [NC,QSA,L]
RewriteRule printable.html$ printable.php [NC,QSA,L]
RewriteRule coupon/([a-zA-Z0-9_-]+).html$ storecoupon.php?cid=$1 [NC,QSA,L]
RewriteRule category/([a-zA-Z0-9_-]+).html$ categorystore.php?cid=$1 [NC,QSA,L]
RewriteRule pages/([a-zA-Z0-9_-]+).html$ cms.php?id=$1 [NC,QSA,L]

RewriteRule print/([a-zA-Z0-9_-]+).html$ printcoupon.php?cid=$1 [NC,QSA,L]
RewriteRule newsletter.html$ newsletter.php [NC,QSA,L]
RewriteRule newslettererror.html$ newslettererror.php [NC,QSA,L]

RewriteRule offers/([a-zA-Z0-9_-]+).html$ detail-page.php?cid=$1 [NC,QSA,L]
RewriteRule submit.html$ submit.php [NC,QSA,L]
RewriteRule contactus.html$ contactus.php [NC,QSA,L]
RewriteRule List-Your-Business-On-CatchCoupon.html$ List-Your-Business-On-CatchCoupon.php [NC,QSA,L]
RewriteRule sitemap.xml$ sitemap.php [NC,QSA,L]
RewriteRule listing/([a-zA-Z0-9_-]+).html$ comment.php?id=$1 [NC,QSA,L]

I believe you are missing a caret(^) sign in your rule

RewriteRule ^products/([0-9]+)/?$ show_a_product.php?product_id=$1

Member Avatar for diafol

They will be because you're not providing a redirection just a rewrite. Use the 'R' flag to redirect. There are other ways e.g.

Redirect 301 /originallocation.php /newlocation.php

Did as you said added R flag:
RewriteRule category/([a-zA-Z0-9_-]+).html$ categorystore.php?cid=$1 [NC,QSA,L,R]

But still not redirectng, both URL are accessable.

Admin,

Please remove all the url from this post pointing to Catchcopons, we are gtting lots of hit to my site from this post.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.