Where is the zend logic for deciding controller? - zend-framework

Ive inherited a project created using Zend.
I need to move the site to a new server, same platform but with a new base URL and domain.
Currently if I go to www.domain.com/index.php the first page of the site will be correctly pulled up. No other pages work.
On the old site, the url convention worked like this: www.domain.us/module/view
So for example the index page could be pulled up by going to www.domain.us/index/index
Im sure this is a simple issue of changing some path or setting (the include path, application path and application environment are dynamically generated and appear to be correct) but I have not been able to find anything.
Where does zend decide what controller to include? Is this url convention of using the subdomain to determine the controller standard and if not any hints as to where this logic might be?

Related

change website from old.mysite.com to new.mysite.com typo3 webserver

First: i am kind of a beginner in web administration. Please be patient ;)
I got a cloned VM from a server with a typo3 website on. i want to make it a test server to test updates and stuff before trying it on the real site.
I want the typo3 website to use staging.mywebsite.com instead of its normal url, but i am not sure where i need to change stuff in order for typo3 to work correctly.
what i did so far:
renamed the folder under /var/www/old.mywebsite.com to staging.mywebsite.com
change entries in /etc/hosts
But i am quite sure i need to change some config files too. Typo3 Version is 9.5
I found this:
TYPO3 How to change the name of a TYPO3 website
But i think thats not what i need?
Thank you in advance.
The URL for the website is defined in the site configuration, see here.
You should modify the entry point as shown in the second image of the documentation (2) or just use the slash "/".
In your example you should use "https://staging.mywebsite.com/". Please keep in mind not forget the slash "/" after the domain.

Add a web page to a site built in Zend Framework

I am a sort-of newbie with MVC and Zend in particular. I have taken over a project from another team, site is built in Zend framework. There is an admin dashboard to add content, assets like images and media, a blog and a portal into Zen Cart for the store.
What is the easiest method of adding a new web page that has as its contents several things that are dynamic - items for sale, music to listen to, blog entries, news items from the database and a featured artist. All of this is stored in the MySQL db. I just do not know enough about MVC to make it work correctly.
I can create a page in the admin dashboard and use as the URL another "module" that already exists, but if I attempt to copy a module folder (for instance the folder called musiclive is almost exactly what I need except I need to add another column of elements...) the admin dashboard does not render. I know that I need to create some sort of "view" and fiddle with or create a controller, but not sure of the easiest method of doing this. I probably have to tell the admin dashboard I have added another "module" but it really is just the main or home page of the site - the other guys never built it because it was rich with details and I guess they put it off. I also probably have to change the files inside the module folder to reflect a different page.
Would love some help or pointers. Ask if you need more details on what the heck I am describing here...
Create a new controller in that same module instead of copying the whole module if the module is so similar to your requirements. And then extend already built resources like forms, models. I strongly recommend you to read about zend framework documentation, especially skeleton application tutorial. That will increase your knowledge as well as make you understand MVC and your current project.
http://framework.zend.com/learn/
One more thing there are 2 versions of zend framework and both are entirely different. You need to know the version in which the project is built. Zend framework 2 has following generic directory structure:
config/
autoload/
application.config.php
module
Application/
config/
src/
view
Module.php
SomeOtherModule/
...
public/
vendor/

URL Routing in Zend

So, I've just started using Zend, moving our companies internal CMS over onto the new Framework, and if you saw the existing code I'm sure you would soon agree the best way to to scrap the whole thing and start over.
So, thats exactly what I'm doing. It's relatively small, so as projects go it shouldn't take too long. Anyhow, to get to the point:
How exactly does routing work in Zend?
I have created a project, and two Modules, one called "default" and one called "admin". If you haven't guessed already I'd like the default module to be the front end of the site, and the admin module to be the backend of the site. When I navigate to ~/public/ I can see the "Welcome to Zend Framework" screen, but when I navigate to ~/public/admin I just get a 404.
What am I missing to get this working? Also, how do I map ~/ to ~/public/ where ~/ is the domain?
As a note, I made the modules and an Index controller within each using the zf tools on the command line using the following commands:
zf create Module default
zf create controller Index -m default
zf create Module admin
zf create controller Index -m admin
Thanks and advance for any help your able to give.
Dan.
'public' should not be in your URLs. Change your vhost so that the document root points at the public folder, not the application root folder, that will probably solve your problem. If not, make sure you have a .htaccess file which includes the mod_rewrite rules as explained in the manual, but if you used the command line tool to generate the project that part is probably fine.

how to change zend controller names gracefully

I currently have a broken site structure that needs repair and I want to do it without doing much damage to whatever little SEO we have currently.
What I have is .com/doctor/office/route/values/here
What I want is .com/doctors/route/values/here
I'm guessing I can just set up a "doctor" controller to redirect all traffic to a "doctors" controller, but I need to make sure that the route values come across properly. I want to make sure it's a 301 to update all of my indexed pages.
Is there something built into Zend to do this easily? Or am I going to have to hack something nasty?
Seems like there are essentially two requirements:
Old urls get redirected to new urls.
New urls get handled by old controllers.
So:
Create a DoctorRedirectController with redirectAction()
Reroute the old urls to the redirectAction(). If you were using default routes before, then add a custom route that maps your old pattern to this new redirectAction. If you were already using custom routes, then just point them to this new redirect controller.
The redirectAction() builds the corresponding new url and does a 301-redirect.
Add routes that map the new urls to the old controller/actions.
No Zend magic, just the grunty work of remapping.

TYPO3 does not resolve url correctly

I'm pretty new to TYPO3 and currently stuck with the following issue:
I copied the templates from another webpage that is currently in business.
When I'm on the startpage of my homepage (www.domain.com) and click on one of the links it contains I always get an error 404. The link that is generated looks like this.
http://www.domain.com/testpage.440.0.html
So I guess something like RealUrl was in use on the webpage that I copied from? Do I understand this right? I don't see that RealUrl is installed though.
However If i manually change this link to
http://www.domain.com/?id=440.0.html
the site is being created.
How does Typo3 know to generate a page when it receives the first version of these two links?
Does not really look like a standard out-of-the-box REAL URL url. That would rather have been /testpage-404.html . So maybe the problem is somewhere else, could be:
simulate static (check if that extension is running). A common mistake is to run real url an simulate static at the same time. If you do not need speaking urls for the moment, just uninstall simulate static.
make sure you add a domain to your shortcut. Use the the list modul and select the root shortcut. Then click create new record, select domain. and enter your domain there. Flush all the caches and try again.
If you'd post your TS Code (of the root shortcut page) here, I could probably tell what's going wrong.
real url configuration typically use .htaccess files.. maybe that file still contains information from the original destination.
check if the root ts contains some baseUrl statement
Which version of TYPO3 are you using?
HTH, but feel free to post more infos.
If your typoscript template is expecting to find realurl and its not installed as a plugin, that could be the cause. You'll need to either install it, or find the settings in the TS template and remove them.
Try the template object browser to look for it (use the template tool, click to the site root, then use the drop down menu in the r/h pane to choose the Template Obect Browser.)
How does Typo3 know to generate a page when
it receives the first version of these two links?
Any page request that it doesn't understand will give a 404 error.