I have a rails controller handling requests to www.mydomain/foo, now I want all traffic to www.mydomain/ (the domain root or homepage) to go to www.mydomain/foo. I asked a similiar question about how to do this with ReWrite, and haven't gotten an answer yet, but I would be happy also solving it in the controller so I have opened up this questrion to allow for either solution. Please help!
I think what you're looking for is map.root
What you pass for the options will depend on your controller/actions setup.
Edit - don't forget to delete the index.html file from the /public directory.
Related
I have a website on a 1and1 server. I have 2 domains on the package; the default url somenumbers.websitehome.co.uk and my actual URL.
The problem is, Joomla quotes the somoenumbers.websitehome.co.uk in system e-mails instead of my actual URL. They both point to the same directory I just don't want to give a stupid URL to my users.
I think I have narrowed it down to the $siteUrl variable but I'm not sure how to go from here.
Thanks
James
At first I thought this sounded largely like a DNS issue - but then you said you only have 1 Joomla installation and both domains point to that directory.
If they're both pointing to the same directory, then both domains will display the same Joomla installation. That is, unless you're checking to see where they are coming from and having the content display dynamically based upon how they got to your site - but from your comments I doubt you're doing that. How your domains are behaving is the expected response if you're pointing them both to the same directory.
If you want 2 sites on the same hosting? Setup 2 databases (or apply different prefix for each site and use 1 database) and set up each website in it's own directory.
Adjust the DNS of each domain name (and subdomain name) to point the appropriate directory.
From there, use the .htaccess file and SEF URL's to get rid of any indicator of the directory so that it displays the same as if the site was in the root directory.
That is the best way to accomplish what you're after - because from the sounds of it Joomla is doing exactly as it should, displaying correctly what is in the directory since both domain names point to the same directory.
$siteUrl should be left blank.
i am stuck with a problem with my ruby on rails.KINDLY help me clear the problem and please provide with a good concept of it also.
Scenario :
uptil now everything was going fine till today.as per a requirement of the application i am supposed to add some static pages to an existing ROR application.basically the application is developed and is working fine and i need to add some static pages to it.i had put some static pages in the public folder and evrything was going so for smoothly.bt at a point in the application , i.e the index page of the application there is a login for the application ( not for the static pages ) and i had put that login in one of the div of those static pages (views/users/index.erb) had copy pasted the code from index.html to index.erb.so the moment i put up the address the login page is delivered and the site navigation works too.but when i click home (page of the public folder is shown up and the code of the application's login doesnt work.) i want it to show up with index.erb that's in the views folder.
i want to redirect somehow to the page in the views (views/users/index.erb) .. tried href etc cudnt work.
hope i could put the problem in a good way for a good understanding of the problem.
and i am using rubymine editor
P.S I am new to ROR .. total new.Had .NET as my domain.so please provide me with some basic tutorial links where i can systematically understand MVC and ROR.Googling dint help :(
waiting for your answers :)
RoR takes a little bit of work and understanding to grasp, mostly because there is so much too it; from "code" to "installation/configuration" to "deploy".
Sounds like you need to look up and understand "Routing" for Static Pages.
You are quite right, the default location will be "public" with the index.html page inside there. Leave that as such; as if your "Routing" is working correctly, then views/users/index.erb will show up.
Just to give you some general direction;
Add your configuration in config/routes.rb
Then use the root to: command.
My configuration: (this links to app/views/static_pages/home.html.erb)
root to: "static_pages#home"
get "static_pages/home"
That works perfectly.
You might also want to check in the "logs" folder for possible errors.
Thanks in advance for any help you can provide!
I have a website built in Ruby on Rails. My site has a webpage, located at example.com/communityboard, that you can use to enter a separate Community area (an off-the-shelf bulletin board called bbPress.)
I want users who type in the URL example.com/community to be redirected to example.com/communityboard . It used to work this way, but for some reason, the redirect no longer works in any browser but IE.
We accomplished this redirect by placing an index.html file in the /community folder where bbPress had been installed. The entire code for the index.html file reads
<meta http-equiv="refresh" content="0;url=http://example.com/communityboard">
Back when we built the site, I was told that a meta refresh redirect using an index.html file was the best option. The redirect had to address ONLY a single page (http://example.com/community) and not all of the sublevels of the community bb (which lives at http://example.com/community/index.php). Otherwise, the community bb and all of its sublevels would be redirected.
So... my questions:
Why is the meta refresh redirect not working anymore?
How can I fix it?
Thanks again for any help you can offer!
If it's only working in IE, it's possible there's a script or parsing issue that's breaking other browsers. I would run the HTML through a validator like http://validator.w3.org/.
Meta-refresh is a legacy practice that is now discouraged -- the wikipedia entry contains more info and links to alternative solutions: http://en.wikipedia.org/wiki/Meta_refresh.
Here's what happened according to my developer. I don't fully understand the explanation, so I'm not sure I can answer follow-up questions! "With the old mongrel cluster, Apache would recognize "/community" as a directory, silently forward to "/community/", which would then pick up the forwarding index.html file. With Phusion Passenger," which I guess we're using now, "Apache sends the request directly to Passenger if "/community" is not a regular file, and Passenger was returning the 404 error. As a fix, we've disabled passenger in the community folder, which fixes the problem."
I have about 50 pages in my Umbraco site and for some reason all of the URLs went from being based on the site structure to either just # or just the id of the page, like /1083
What would have caused that to happen and how can I fix it now?
Also, it would be nice to understand how these URLs get created if there is some method somewhere that manages it or they are in the database somewhere.
Delete the App_Data/umbraco.config file and then go into the admin and republished the whole site.
Thanks #Pauli
I have some pages organised like this:
http://localhost/index.html
http://localhost/download.html
http://localhost/contact.html
And I need them changed to suit the following URL structure:
http://localhost/
http://localhost/download
http://localhost/contact
Without making sub directories and putting in pages as index.html. As far as I know .htaccess can be used for this, but I have no idea what I need to add to my .htaccess file to make this work.
Can anyone provide some help? Thanks.
Are you looking for this? Here's another page. And here's a discussion about it.