S
S
steve1932015-06-29 08:16:30
PHP
steve193, 2015-06-29 08:16:30

How to redirect from html to php in .htaccess without displaying the extension?

Question on .htaccess
, I had files in html format, I translated them into php and in .htaccess I indicated that the extension was cut off, (not /shop.php , a /shop ) everything works, but there is a problem, there is a link in Google AdWords an ad with an html extension and when you click on an ad in Google, you go, or rather you don’t go to the html page, because it doesn’t exist, it’s now php, and you can’t change the link in Google, the CTR of the ad will fly off. How can this be resolved here, namely, so that when clicking on the link from the shop.html ad in Google, the user gets to the shop.php page, which in turn will be displayed /shop with
MB redirects?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Andreev, 2015-06-29
@DragorWW

.htaccess
RewriteRule (.+)\.html$ /$1/ [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question