Craftcms route is not working in local, but it's working on server - craftcms

How are you?
Yesterday, I deployed craftcms project 2.9.2 on my local. But the route is not working for me.
For example, if I type as localhost in my browser(http://localhost), it's working but if I click any item on the home page(http://localhost/collection), it's not working, I'm facing Not Found page as default. This project is working on a cloud server.
I'm not sure why it's not working when routing.
Please help me.
Thanks!

It's possible something's misconfigured.
I'd start with the env looking for a base url that needs fixed.
I'd go to the site settings if you haven't got the base url in your env
Then I'd log in to craft and check the sections. If the paths have a full url baked in then you'll have issues.

I had a similar issue and it turned out my .env file had the dev server public paths set to = "http://localhost:9090", but they needed to be https.
Once I set them to "https://localhost:9090" the routing worked.

Related

IIS 6 .NET MVC web app deployment - need to achieve a specific URL structure

I need my local (testing) deployment to respond to a URL like
http://localhost/apps.mydomain.com/myappname
not
http://localhost/myappname
Long story as to why but I just need that to be the case.
I actually had this working for awhile but I can't remember how. I had to delete and add the site again and now can't figure out what combination of settings gave me the result.
How can I achieve that URL structure locally?
MORE INFO: I've created a website called "apps.mydomain.com". I then added an application under that site with the alias "myappname". This app can be invoked with URL
http://localhost/myappname
Why? What happened to "apps.mydomain.com"? When I add it...
http://localhost/apps.mydomain.com/myappname
I get a 404.
You can just create directories apps.mydomain.com and apps.mydomain.com\myappname under C:\inetpub\wwwroot.
Or, if you don't want to publish your application in wwwroot, you can create virtual directory in IIS.

Why is contents of _Layout.cshtml missing when running locally on IIS7.5?

I am testing an mvc4 site locally and have set up my hosts file / IIS so that I can run it from a test domain name. I am following instructions from here: http://ben.onfabrik.com/posts/oauth-providers
When I access it via the bound domain set up in IIS it does 'work'... but the entire contents of _Layout.cshtml are missing. All that displays is the html from the View being called.
When I run the site using the Debugger, or on live hosting it comes up as expected. So I don't think there's any problem with paths, or using ViewStart.
It's only when accessing it via the domain (bound to localhost on IIS) that the _Layout.cshtml content is missing.
Any ideas as to why this might happen and how I can resolve it? Thanks
This doesn't answer the question, but until somebody can offer a better response, it might help others in a similar position.
I had to run the site from VWD using the Debug button - that runs the app on the standard .Net Development Server, which gives you a port number.
Adding that port number to the end of my domain name made my _Layout.cshtml display.
e.g. http://testdomain.com:54829/

lvh.me:3000 no longer resolving to localhost:3000 for testing subdomains in development

I followed Railscast 121 to set up subdomains for my site, www.blog.com, and got everything working in development. I could use lvh.me:3000 to access my application at both the root url www.blog.com and at the specific subdomains I set up e.g. john-doe.blog.com
After pushing to Heroku, I can no longer connect to the root url at lvh.me:3000. What could be causing this?
Symptoms in development environment:
I can access www.blog.com through localhost:3000.
I cannot access www.blog.com at lvh.me:3000. but CAN still access john-doe.blog.com.
I opened a DIFFERENT application www.secondapp.com, and the root path for this also works at localhost:3000 but not at lvh.me:3000. I have not set up any subdomains for secondapp, but tried the url john-doe.secondapp.com just in case, and for some reason, this works. Very strange...
I must have inadvertently adjusted some files, but I don't know where/how. It's completely beyond me why a completely different app would work with a subdomain for an unrelated app. Any feedback would be much appreciated.
This is because of the current godaddy outage. Once their DNS is back up, it should resolve correctly.
In the meantime, you can try editing your hosts file.

MVC.NET 404 outside of Domain

I am trying to get a demo site for a client setup. This is the 1st application my company is doing in MVC.NET, so I get to experience all the new things to find out (and all the headaches it'll cause).
Anyway, the site works fine locally (localhost) and on the server inside our domain. External users not on the domain however, only get 404 errors. I've tried several different settings/ config options I've found on this site, but nothing is working. I don't know if it's a web.config issue or an IIS issue, or even simply a permissions issue (though it has all the same permissions as the other sites we run with Web Forms).
IIS: v7 in intergrated mode.
Windows Server Web
Well, because you received a 404, the server is being reached okay which is a good sign. (Dealing with firewall issues at a company is always a lot of fun.)
A common problem for something like this is the use of virtual directories to host the website. For example, if the address to your site is http://example.com/MySite/, in MVC that would translate to: /MySite/View/Index.aspx. HOWEVER...if you are using virtual folders, /MySite/ may instead point to another spot on the server (e.g. C:\WebSites\MySite). If you are indeed using virtual paths, make sure you have your files stored at the correct path.
There is a troubleshooting tutorial here: http://support.microsoft.com/kb/248033
thanks for the answers everyone. Turns out it was something with our DNS routing setup with the sub-domains. It was getting rerouted to a place that didn't exist. Our IT guy finally got around to fixing it (ugh!)

MVC - Routing not working within intranet

I don't know anyone can help but I'd appreciate any. I am developing an app in mvc (c#), now I had various routes working on my local development machine when the app was stand alone however now I've tried adding the project to the test intranet at work and none of the routes are working.
So where Localhost/Admin/Create worked fine locally where admin is the controller and Create is the action, when I try to get to testintranet.mywork.com/intranetsection/myproject/admin/create I'm getting a file not found error. I'm not sure what I need to change to get it to pick up the routing again rather than look for the literal path. The default.aspx page works fine and gets called but apart from that nothing. Is routing only viable when in a standalone project?
Cheers for any help.
It looks like you're either running on IIS 6 or IIS 7 classic mode. If you can, I'd recommend updgrading to IIS 7 integrated mode. If not, I have a walkthrough for getting up and running on IIS 6.
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
You don't say what version of IIS you have deployed to, but you may be running into the issues described here:
http://blog.codeville.net/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/
I believe that most people chose to resolve this using a wildcard mapping for the aspnet_isapi.dll.

Resources