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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 343k
  • Answers 343k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The problem with ur code is that u are initializing… May 14, 2026 at 5:24 am
  • Editorial Team
    Editorial Team added an answer The value of AccessSourceAll is (int)0xFFFFFFFF since enum is of… May 14, 2026 at 5:24 am
  • Editorial Team
    Editorial Team added an answer As donroby said it's perfectly legitimate for the parser to… May 14, 2026 at 5:24 am

Related Questions

Commonly, a website has a menu bar with links to different pages of the
I enabled URL rewriting on my PHP site with Apache ( http://example.com/index.php?param=12 becomes http://example.com/index/param/12
I'm currently using PHP, JAVASCRIPT, MYSQL, XHTML, CSS to develop my site. Note that
Over the last few weeks I have been studying the MVC design pattern for
What's the best practice for making sure that certain ajax calls to certain pages

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.