0

I am asking the same question that has already been asked several times but none of them has answered so far.

I want to redirect the website to the clone folder on the web server.

Following URL was previously in use.

http://www.websiteurl.com/vshop/index.php?page=shop.product_details&product_id=440

Now i've a new setup on the same URL but different folder.

http://www.websiteurl.com/payonline/index.php?page=shop.product_details&product_id=440

The first folder name is "vshop" and 2nd one is "payonline".

Can somebody please tell me how can i keep the complete url, but change the folder name, I don't want to use "search or replace" feature. I might need to change the complete domain.

Please do also tell me if .htaccess is better of php script will work fine. Thanks

MFarooqi
  • 1,004
  • 5
  • 12
  • 26
  • 1
    Do you mean changing the **folder name** rather than the **domain**? – Alex Lau Feb 24 '15 at 09:47
  • here I wanted to change the **folder name**, but then i decided to remove only **folder** in the **redirected url.** . BTW. domain is same. – MFarooqi Feb 24 '15 at 15:05

1 Answers1

2

This Htaccess RewriteRule should do it for you.

RewriteEngine On
RewriteRule ^vshop/(.*) payonline/$1 [QSA] 
ʰᵈˑ
  • 11,279
  • 3
  • 26
  • 49
  • Thanks.. let me try. and what if need to remove payonline folder and redirect it to main site?. – MFarooqi Feb 24 '15 at 10:39
  • wow.. it worked. thank you.. I just remvoed vshop and payonline `RewriteEngine On' RewriteRult ^/(.*) /$1 [QSA] ` but it keeps **vshop** on url – MFarooqi Feb 24 '15 at 10:43
  • Glad it worked for you and helped you solve your problem(s) `:D` – ʰᵈˑ Feb 24 '15 at 10:49