Hi,
I really need your help regarding an issue I'm facing with .htaccess file.
I've recently moved my website from html to php. Now, I want to redirect few old html pages to new php pages. The problem is that the file names are different.
Example:
How to redirect: http://www.example.com/Patent_Filing_Support.html#
To
http://www.example.com/services_and_pricing.php
Your help is appreciated. Thanks a lot.
301 Redirect from old html pages to new php pages
Moderator: Project members
-
- 500 Command not understood
- Posts: 1
- Joined: 2012-10-22 07:48
- First name: Karan
- Last name: Sachdev
-
- 500 Command not understood
- Posts: 4
- Joined: 2013-09-01 13:59
- First name: Pieter
- Last name: Oliehoek
Re: 301 Redirect from old html pages to new php pages
I would do it quick an dirty:
Code: Select all
<html><body>
<p><a id="rd" href="http://www.example.com/services_and_pricing.php">Click here !!</a>
<script language="javascript" type="text/javascript">
window.location.href = document.getElementById('rd').href;
</script>
</body>
</html>
Re: 301 Redirect from old html pages to new php pages
Put
Redirect /Patent_Filing_Support.html /services_and_pricing.php
into .htaccess
Redirect /Patent_Filing_Support.html /services_and_pricing.php
into .htaccess
- Ramesh8248
- 500 Command not understood
- Posts: 2
- Joined: 2014-01-22 11:59
- First name: Ramesh
- Last name: Pardhi
Re: 301 Redirect from old html pages to new php pages
in .htaccess add this code
For example
I have to redirect http://www.example.com/mypage.html to http://www.example.com/mypage.php
then, add following code to .htaccess file
Code: Select all
Redirect 301 /htmlpage /Yourphppage
I have to redirect http://www.example.com/mypage.html to http://www.example.com/mypage.php
then, add following code to .htaccess file
Code: Select all
Redirect 301 /mypage.html /mypage.php
<Please read forum rules, no commercial links in signatures, posts and profiles!>