简体   繁体   中英

Redirect existing url .php to new url

How to redirect existing url to new url?

Sample : I have www.a.com/help.php

in google/yahoo : when visitor click this link "www.a.com/help.php" on address bar automatically change be www.a.com/help.

Because in .htaccess I was rewrite www.a.com/help and this condiction is success.

The problem is how to change automatically on address bar www.a.com/help.php --> www.a.com/help

Using .htaccess or other tricks?

Thanks.

You could use

<?php
header("Location: http://www.a.com/help");

That should change the addressbar.

With .htaccess you could try

redirect 301 /help.php /help

Here you can read more on htaccess redirect

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM