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 6721983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:23:37+00:00 2026-05-26T09:23:37+00:00

I am remaking an old php website into RubyOnRails (3.0.3). The existing website (written

  • 0

I am remaking an old php website into RubyOnRails (3.0.3). The existing website (written in php) has been online for some years now and gained a lot of links and is well positioned in Google.

Now, since I am releasing it in Rails on the same domain I want the old files to be 301 redirected to the corresponding file in the new version. What would be the best way?

These are the circumstances:

  • I am building the new website on the same domain where I am replacing the php-version
  • There is no logic in how the files have been renamed. For example http://www.domain.com/cat/home/page/helloworld.php might have its corresponding place at http://www.domain.com/stuff/hello-world-in-rails and some files have been removed etc.
  • Thus, I would like to specify in a table, or similar, where one column is the old path and the other column is the new path. When someone tries to access http://www.domain.com/cat/home/page/helloworld.php they will be 301:d to http://www.domain.com/stuff/hello-world-in-rails

When I have made php-sites into WordPress I have solved this by adding a redirect code in each php file pointing to the new path (in WordPress). Since my Rails-installation doesn’t support php-files, this is not possible however.

I assume mod_rewrite is my weapon of choice, but how should I go at it?

  • 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-26T09:23:37+00:00Added an answer on May 26, 2026 at 9:23 am

    You can manage all the redirections in the routes file. Here the documentation f the routes, espacially the redirct method will be interresting for you!

    http://guides.rubyonrails.org/routing.html#redirection

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a java simulation game for some time (remaking theme
I'm considering remaking my blog(currently in PHP, but <100 lines of non-layout code) in
So the USDA has some weird database of general nutrition facts about food, and
My grid view has some items I can remove each sucessfully by just writing
I'm remaking an old warcraft 3 custom game that I used to play way
I am on the verge of remaking an application for e-learning. But now I
We're making an app using PHP and using some third party services that require
I am remaking a page on the admin section of a website I administer
We're making some calls to some very simple JSON web services in .NET CF
We're making this web app in PHP and when working in the reports we

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.