Forum Moderators: phranque

Message Too Old, No Replies

How to redirect hundreds of aspx pages to php pages

         

piya124

10:05 am on Aug 28, 2011 (gmt 0)

10+ Year Member



I have a website which was built on ASP.Net platform. Now we are revamping the entire website and building it on a PHP platform.
The problem is that many pages of the aspx version of my website rank very high in the search engines. Now in the revamped website, although the content will be same but the extension of the pages will change from aspx to php. Thus I am worried about the search engine rankings. Their are more then 5000 images and 400 pages and thus it extremely difficult for me to redirect each and every link to its new url.
What should I do? Please help. I don’t want to lose the search engine ranking spot of my pages. The url of the website remains the same but the extensions change.

Also the new website will start functioning from 1st September. Please reply soon.

phranque

10:18 am on Aug 28, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



create a mod_rewrite rule to internally rewrite all .aspx files to the equivalent .php files.
the visitor will still see the .aspx url and you will still link internally (and externally) to the .aspx urls.
make sure to position your internal rewrites after any rules for external redirects or you risk exposing the .php. urls.

g1smd

10:24 am on Aug 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, continue to link to .aspx URLs from within the site and set up mod_rewrite so that incoming .aspx URL requests are internally rewritten to serve content from the new .php files.

URLs are used out on the web. Files are used inside the server. They are not at all the same thing. Use a rewrite to change this association. Do not use a redirect.

piya124

12:00 pm on Aug 28, 2011 (gmt 0)

10+ Year Member



Thanks phranque and g1smd.
But I am a complete novice to all this.
Can you please explain in detail what should I do?
What and where should I write in my server.
Please explain in detail. It would be of great help.

lucy24

8:43 pm on Aug 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Look back over the last week of posts to this forum, and bookmark this page [httpd.apache.org]. If you are rewriting all asp pages to php, it doesn't matter if it's one or a thousand. It won't take much more than one Rule with one attached Condition.

But can you really get away with this forever? Sooner or later g### or somone like them will get wind of the "real" extensions, and then the Duplicate Content ### will hit the ### won't it? Do you do a sort of two-step where external requests for php get redirected to asp and then rewritten to php again?

g1smd

10:20 pm on Aug 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Someone else asked almost the same question the very same day, so here's the answer to that: [webmasterworld.com...]