Travelers
Travelers

Reputation: 67

How to avoid the multiple path to same file in php using htaccess?

enter image description hereMy url is

 www.abc.com/cbn/either/index.php

and I want to access this by only current url. When I change the path of the index.php file, i.e.

 www.abc.com/cbn/index.php 

Still, I am accessing index.php file which is a bad approach for SEO point of view because now google will index two URLs of the same file. So please help me out to fix this problem.

Upvotes: 1

Views: 320

Answers (1)

splash58
splash58

Reputation: 26153

Add such line in your htaccess after RewriteBase

RewriteRule cbn/index.php /cbn/either/index.php [R,L]

Upvotes: 1

Related Questions