Hi, I have a website with more than 1000 pages. Now I want to rename the file names to make it more SEO friendly. My friend suggested me to rename it to improve the search engine ranking. For example, currently I have: page234.php I want to change it to: php-example.php Is the PHP redirection method will help? what is the best method to achieve this? please help.
....i'm confused. are you talking about renaming files or redirecting your pages? for redirecting, just use: header (Location: URL); otherwise, i don't think theres a php function to rename files on a web server, but i'd try PHP.NET if anything.
Sorry for the confusion. I am going to rename the files and remove the old files. So, I need to redirect all the old files to new files.
Along the lines of what mikeloring suggested - strip the content out of the old files and just replace it with <?php header("HTTP/1.1 301 Moved Permanently"); header ("Location: http://www.yoursite.com/yournewpage.php"); ?> PHP: This redirects users and tells spiders to reindex using the new address. Edit: SE backlinks and PR will eventually migrate to the new address too.
Hello, There are two ways: 1- header() In your PHP as said void 2- htaccess IE: RewriteRule ^page234.php?$ /php-example.php.php [QSA,L] Best, jakomo
okay. thanks. I have some files which are static html. How can I redirect those files ? Also, how it reacts with SE's? for example I have: page234.html I want to redirect it to: php-example.php thank you