Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3223092
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:04:00+00:00 2026-05-17T16:04:00+00:00

I need help with deciding how to redirect my old urls to the new

  • 0

I need help with deciding how to redirect my old urls to the new ones.
At this moment I have the urls like

myhost.com/viewrecipe.php?id=2

But I want them to look like

myhost.com/recipes/pear-pie

The problem is that the website is already indexed in Google. Is there any way to write a 301 redirect for search engines to redirect them from the old type of urls to the new one?

If it’s impossible to achieve without using id in the new url type, what are other option to makethis transition as smooth as possible for search engine?

P.S. all those are dynamic urls

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:04:01+00:00Added an answer on May 17, 2026 at 4:04 pm

    You can use a .htaccess file in the root of your application containing:

    redirect 301 viewrecipe.php?id=2 http://www.myhost.com/recipes/pear-pie
    

    Yes this will be needed for all your URLs… if not you can’t try to write a rewrite but you will neded the id on the new seo-friendly url.

    Another way will be to be able to acces to viewrecipie.php?id=2 and code something like:

    <?php
    // get the new name dependeind of the id
    $slug = Posts::getByID($id);
    
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: http://www.myhost.com/recipes/".$slug);
    ?>
    

    And a shortest way:

    header("Location: http://www.myhost.com/recipes/".$slug",TRUE,301);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need Help - I have some code for Logout like this public void logoutFromFacebook()
need help in error in database pivot. i have table tamed table_score like below:
Need help with my simple PHP menu. I'd like to have something like that:
I am relatively new to revision control and I need some help deciding if
Need help with a query that I wrote: I have three tables Company id
Need help writing a script downloads data from google insight using c# this is
need help/guide for sql select query, I have 2 table stock and stock_history, in
need help regarding USSD Gateway. I have to develop an app, which will directly
I need help with one ajax function This is raw page setup. Page will
I need help in deciding with search algorithm to use for searching large files.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.