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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:44:03+00:00 2026-05-13T13:44:03+00:00

I have a site, say, example.com, which is PHP. I am converting it to

  • 0

I have a site, say, example.com, which is PHP. I am converting it to Rails, but there are three years worth of issues (like magazine issues) that I don’t want to update. Thankfully, it seems that I chose an advantageous url format, ie. all issues start with two digits, then the name of the file in most cases

example.com/00/author-name/index.php
example.com/19/author-name.php

I want to redirect via 301 all requests for those php files to

archive.example.com

And make the top level example.com a Rails site, serving up the latest issues.. ~/20/author-name

The subdomain is on dreamhost, and the top level will go to heroku. (So this is not part of the question.) Thanks.

  • 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-13T13:44:03+00:00Added an answer on May 13, 2026 at 1:44 pm
    ActionController::Routing::Routes.draw do |map|
    
      map.connect '20/:name', :controller => :twenty, :action => :show
      map.resources :twenty, :as => '20', :only => [:index, :show] 
    
      map.connect ':url', :controller => :archive, :action => :show,
                         :requirements => { :url => /(([0-1]){1}([0-9]){1})(.*)/ }
    
      map.root :controller => :pages, :action => :cover  
    
      map.connect ':controller/:action/:id'
      map.connect ':controller/:action/:id.:format'
    end
    

    For any request coming to domain/00 to domain/19 I redirect in the controller

    redirect_to "http://archive.example.com/#{params[:url]}", :status => 301
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a input tag which is non editable, but some times i need
I have a snippet to create a 'Like' button for our news site: <iframe
We manage a site for a medical charity. They have a number of links
I have found this example on StackOverflow: var people = new List<Person> { new
I have a login.jsp page which contains a login form. Once logged in the
Let say I have the following desire, to simplify the IConvertible's to allow me
I have a project that adds elements to an AutoCad drawing. I noticed that
I have a script that appends some rows to a table. One of the
I have a new web app that is packaged as a WAR as part
I have several USB mass storage flash drives connected to a Ubuntu Linux computer

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.