Solved

change default URL rails 2

Posted on 2011-09-13
8
325 Views
Last Modified: 2012-08-14
rails 2.3 app, the index is example.com/

for seo i want the home page URL to be example.com/something how do i use routes.rb to make this happpen?
0
Comment
Question by:depassion
  • 3
  • 3
  • 2
8 Comments
 
LVL 10

Accepted Solution

by:
Andrew Doades earned 250 total points
ID: 36531927
Something like this:

map.root :controller => welcome', :action => 'index'
0
 

Author Comment

by:depassion
ID: 36531935
i already have

 map.root :controller => 'info', :action => "index"

that makes example.com/ how to i add the /something?
0
 
LVL 10

Expert Comment

by:Andrew Doades
ID: 36531960
So when you first boot or access your site on example.com you want it to redirect to example.com/something?
0
 

Author Comment

by:depassion
ID: 36531986
yeah i think so, i just want to add a keyword into the URL for SEO optimization.

example.com/something is the same as example.com/ with this:

map.something "/something", :controller => 'info', :action => "index"

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 10

Expert Comment

by:Andrew Doades
ID: 36532033
OK, so (sorry if I'm missing something!) can't you just use those two routes?

map.root :controller => 'info', :action => "index"
map.something "/something", :controller => 'info', :action => "index"

So, http://example.com/  goes to controller 'index' action 'welcome' and if people type http://example.com/something it still goes to controller 'index' action 'welcome'?

Andrew
0
 
LVL 12

Assisted Solution

by:JESii
JESii earned 250 total points
ID: 36533477
To clarify: is "something" a page that you have created yourself and is it different from the "index" page? Or is it a controller called "something" that you want to create?

What do you want to put on that page and why do you want it to be separate? Since you mention "seo", I'm guess that the word "something" is key to your site... right?

So. Create a controller called "something", add an action/page called "index", then do a
     map.something "/something", :controller => 'something', :action => "index"
similar to what #doades mentioned earlier.
0
 

Author Comment

by:depassion
ID: 36535512
there is no difference in the /something compared to the home page. Maybe all i need to do is submit the URL to google as www.example.com/something as the home page.

yeah the "something" keyword is just for SEO.

getting keywords in the URL as much as possible helps with SEO
0
 
LVL 12

Expert Comment

by:JESii
ID: 36537835
Fine. Then the suggestion to map "/something" to whatever you want your home page to be is the way to go.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I recently rediscovered rails when I needed a holiday project and decided to build a management dashboard for the company where I work.  With it being a project done in my free time, I could focus my time on learning the basics rather than trying to…
Article by: narshlob
If you've ever programmed in Ruby and have come across either a proc or a lambda, you might have been wondering what the difference is between the two and when you would use one over the other. This article will try to explain the difference between…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now