TYPO3, realurl not working after change the domain - php

We have an old TYPO3 site (v4.7) and we moved the site to another domain.
now all the pages give the error: 404 Not Found
when I tried to get the page using URLs containing page id like /index.php?id=2, it works
how can I fix the site to works using real spoken URL /page-name
thanks

First of all you should change the domain record (in the backend, at the root of the domain in "List" view).
Maybe the domain is hard-coded in your realurl-config which is usually at /typo3conf/realurl* (realurl-extension configuration in the extension manager). If you selected "auto-configuration" in realurl's extension configuration and nobody made the mistake to make changes to the file directly, you can delete it and let it regenerate.
Maybe TypoScript settings like config.baseURL or config.absRefPrefix have a say here, too. I suggest to check in the template analyzer (backend: "Template" -> select your domain's root -> template analyzer -> view complete listing) if there is something with the old domain.
Of course, realurl needs to be activated (TypoScript config.tx_realurl_enable = 1) but if you did not change it, that should not have changed.
Then of course clear all caches (preferably via the function in the Install Tool).
If you still have problems, deleting /typo3temp (and recreating it via the InstallTool) might help. And check if there's something useful in the logs, of course (where, depends on ['SYS']['systemLog'] and ['SYS']['systemLogLevel'], probably typo3temp/*.log or your PHP error log).
Good luck with that ole' T3 ;)

Related

How to send web pages for which explicit files do not exist

How do CMS's such as MediaWiki, Drupal, Wordpress etc. display the correct pages when a URL is for a directory/file which doesn't exist.
To clarify, if I go to the url https://en.wikipedia.org/wiki/Example, there is no directory on wikipedia's server /wiki/Example, instead MediaWiki creates the page from templates and information in databases etc. I'm asking how the CMS "Hijacks" the request for that directory/file in order to send it's own page back rather than a 404.
I'm asking with regards to php as that's what I'm using and what most CMS's seem to be primarily based on.
Web server (i.e. Apache, Nginx...) has possibility to catch requested URL and to convert them to something else, some other URL. Most common way is by using .htaccess file placed in site's root directory. In some systems files starting with dot (".") are hidden by default so you must enable somewhere something in order to see them at all.
It contains rules (among other things) how to recognize some routes or set of routes and what to do with them them.
I.e. you have "virtual" path like:
/event/32
You'll create a rule to catch every path that starts with "/event/" and also catch part after that ("32") and instead of opening un-existing directory it will call some script like:
/event.php?event_id=32
So that captured parameter has been sent as get parameter "event_id" to event.php script.
For this search/replace and capturing path part regular expressions are used.
You have many tutorials online how to do that, just google for them:
https://www.addedbytes.com/blog/url-rewriting-for-beginners
https://mediatemple.net/community/products/dv/204643270/using-htaccess-rewrite-rules
https://help.dreamhost.com/hc/en-us/articles/215747748-How-can-I-redirect-and-rewrite-my-URLs-with-an-htaccess-file-
....
Main server configuration is placed in some other server directory, most likely accessible only for server admin. But this .htaccess file a a way to allow "common users" to do some configuration changes, which will apply only for directory where that file is placed and it's children.
But you can also do a lot of other thins with .htaccess file, i.e. send some header parameters, allow/forbid access to some files/directories, set some simple login mechanism (password protection) and much more...
The basic concept is very simple:
Use a custom 404 instead of the default
Dynamically generate content based on the entered url

Joomla administrator redirects to installation

I have a Joomla 2.5 site were I can no longer access the administrator panel. That only redirects me to /installation/index.php which (as it should) gives a 404. I think this happened after an upgrade.
I tried to clear browser cache as suggested here: Joomla 1.0, administrator link redirect to "installation/index.php", how to prevent this redirection?
But that didn't work.
A long time ago, back in the 1.x days, there were some security advices on the Joomla site which among other things suggested to move configuration.php outside the public_html directory which I followed. I can't find them now, but I tried to copy the configuration.php file to Joomla root directory as well as keeping it at the directory which is defined in defines.php (define('JPATH_CONFIGURATION').
Any ideas?
My extensions
bash-3.2$ find plugins/ -type d
plugins/
plugins/authentication
plugins/authentication/gmail
plugins/authentication/joomla
plugins/authentication/ldap
plugins/captcha
plugins/captcha/recaptcha
plugins/content
plugins/content/emailcloak
plugins/content/finder
plugins/content/geshi
plugins/content/geshi/geshi
plugins/content/geshi/geshi/geshi
plugins/content/joomla
plugins/content/loadmodule
plugins/content/pagebreak
plugins/content/pagenavigation
plugins/content/vote
plugins/editors-xtd
plugins/editors-xtd/article
plugins/editors-xtd/image
plugins/editors-xtd/pagebreak
plugins/editors-xtd/readmore
plugins/editors
plugins/editors/codemirror
plugins/editors/none
plugins/editors/tinymce
plugins/extension
plugins/extension/joomla
plugins/finder
plugins/finder/categories
plugins/finder/contacts
plugins/finder/content
plugins/finder/newsfeeds
plugins/finder/weblinks
plugins/quickicon
plugins/quickicon/extensionupdate
plugins/quickicon/joomlaupdate
plugins/search
plugins/search/categories
plugins/search/contacts
plugins/search/content
plugins/search/newsfeeds
plugins/search/weblinks
plugins/system
plugins/system/cache
plugins/system/debug
plugins/system/highlight
plugins/system/languagecode
plugins/system/languagecode/language
plugins/system/languagecode/language/en-GB
plugins/system/languagefilter
plugins/system/log
plugins/system/logout
plugins/system/p3p
plugins/system/redirect
plugins/system/remember
plugins/system/sef
plugins/user
plugins/user/contactcreator
plugins/user/joomla
plugins/user/profile
plugins/user/profile/fields
plugins/user/profile/profiles
Try this, if wont work move to another point.
1. Change this
if (file_exists(JPATH_INSTALLATION.'/index.php')) {
header('Location: '.substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'index.php')).'installation/index.php');
To this:
if (file_exists(JPATH_INSTALLATION.'/index.php')) {
header('Location: '.substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'index.php')).JPATH_INSTALLATION.'/index.php');
Its line 25-26 in administrator/includes/framework.php
2. Remove line 23-32 in this file - it checks for installation folder and size of configuration file, if you dont have installation folder and configuration file is ok, you can remove this
3. set variables $sef and $sef_rewrite to zero in configuration.php
Diagnosing The Situation
Perhaps you should start with diagnosing the plugins? By removing them all and adding in one by one to see what one causes an issue. As you recently updated, a plugin perhaps is causing this issue as it is outdated and is creating conflictions between the software and the extension.
The issue may be based around that the configuration cannot be found, so Joomla presumes you have not installed the software.
Have you done all of these?
Removed installation folder
Checked if .htaccess isn't causing the issue
Attempt a downgrade and upgrade?
I think plugins would not cause redirecting to installation folder. Most likely the system thinks it's not installed yet, which would most likely be caused due to a missing configuration.php file in a location where Joomla expects it to be.
You can try to add something like this to the end of defines.php:
var_dump(file_exists(JPATH_CONFIGURATION.DS.'configuration.php'));
If it outputs true - that means config file exists and the problem is not in it.
Then I would rename .htaccess to htaccess.txt to make sure it has no effect.
If that doesn't work you could also lookup index.php file in public_html folder and make sure no changes have been made to it.
I'm pretty sure config file is not in its location and this should resolve your issue. Hit me back if it doesn't and I will help you further.
Try this things
Delete the joomla installation file directory: c:/host/project path/your site/installation
Check your server and restart it
Be ensure the required services are available on the server
Try installing the new Joomla package http://www.joomla.org/download.html
Thanks
IMHO you need to delete the /installation folder after an installation. Otherwise if it finds this folder and you get redirected there.
For security reasons Joomla does not allow you to be redirected to your site front-end or back-end before you delete the installation folder after the installation is complete.Please make sure the joomla /installation folder is deleted, and if yes, restart your server if possible.

Mage registry key "controller" already exists

I have configured an ecommerce site using Magento, but it is throwing an error.
Mage registry key "controller" already exists
I am not sure what to do. The URL for site is http://musicademy.sweetersinging.com/store/admin
This usually happens if you try and run Mage::run() twice - or specifically, once more after the index.php bootstrap.
Sounds like a (extremely) badly written 3rd party extension or template. It (sadly) wouldn't be the first time I've seen someone execute this within a .phtml file.
Go through the standard debug process, refresh between each.
Move app/code/local to app/code/local.bak
Move app/code/community to app/code/community.bak
Move app/design/frontend/your_custom_package to app/design/frontend/your_custom_package.bak
Once you've found the cause above, then you can start to filter through the filters/dirs to check.
If you have Magefirewall extension installed try disabling at the webserver(by going to magento_root_dir/app/etc/modules/magefirewall.xml) and clear the cache (by deleting all the files/folders in magento_root_dir/var/cache/) if you don't have access to the admin panel. Doing this solved the issue for me on Magento CE 1.9.2.2.

Magento helloworld tutorial

We're working on Alan Storm's tutorial: Magento Controller Dispatch and Hello World on Magento 1.5.0.0.
at the step:
Clear your config cache, and load the following URL
http://exmaple.com/helloworld/index/index
and it produces a page not found error, as follows:
Whoops, our bad...
The page you requested was not found, and we have a fine guess why.
If you typed the URL directly, please make sure the spelling is correct.
If you clicked on a link to get here, the link is outdated.
Two of us are working on this. One of us on a Linux platform, the second on Mac OS X 10.6.7. The same "page not found" error on both platforms. We both have double-checked each other's tutorial code by comparison to Alan's article. It seems that something is remiss in the tutorial code in that it would not work on two independent platforms.
What is the best way to move ahead with debugging something like this?
First check the module is active, at the very least it should appear in System > Configuration > Advanced > Disable Module's Output or use Alan's Module List.
Next, double check for typos in the controller class and pay particular attention to the case. In the config frontname should be frontName (a capital N is often overlooked).
I had the same problem , Double check your /path/to/magento/app/etc/modules/Module_Name.xml , I had the codePool set to "community" and placed my extension in "local" directory this caused the 404 issue, when I changed the codePool value to "local" everything worked
example.com (or exmaple.com as typo'd in the tutorial) is a placeholder link used in documents. You are supposed to replace it with your own hostname, i.e. if you are developing on a local webserver http://localhost/, like this: http://localhost/helloworld/index/index
Just stumbled over the same problem and found the solution to be that mod_rewrite has to be enabled on the server for the URL given in the tutorial to work. Elsewise, it will work with the following URL as well:
http://exmaple.com/index.php/helloworld/index/index
try by adding "index.php" in your url.
For example: http://example.com/index.php/helloworld/index/index
If you are done with this. Search some article to remove index.php from magento.
I am on magento 1.8 and i fixed my 404 error by doing the following. inside Magentotutorial_Helloworld.xml they tell you to put this code in "local" since i do not have a local folder i put mine into the community folder. Change the code to this and it will work. "community"

How do I get CakePHP configured so it shows up correctly in my browser?

I am a cakephp newbie and I had trouble to view the files under the view folder through browser.
I used cakephp console to bake model, controller and views. (ex: Invoices_controller.php for controller, invoice.php for model and a invoices folders under views folder). According to the tutorial I read, I can access the invoice view by typing http://localhost/myProject/invoices
(there is no index.php inside the invoices folder..but the tutorial shows it still can display a page. no idea how they did it)
The path for my invoices is myProject/views/invoices and there add.ctp, index.ctp, edit.ctp files inside the invoices folder.
The browser showed the file is not found when I typed http://localhost/myProject/invoices
You have some lack in your knowledge about how the webserver handling a request when cakephp is installed. Assume that we use apache.
In cake's folder structure you can see .htaccess files in the root, app and webroot directories what have url rewrite rules in them. At the end a normal request to a cakephp site will be transformed to a http://site.url.root/app/webroot/index.php?url=original.url
In nutshell to understand it in your point of view:
That index.php call the required php files and at least a cakephp app object is built up in the memory with the required models and methods. Then the app object let say start and calls its methods (model, controller and view methods) and at the end it gives back a result to apache what serves it to you.
Therefore the original url path is a "non existent" virtual url.
If you enter http://localhost/myProject/ do you get a cake intro page? If so does it highlight any problems?
It sounds to me as if you do not have Apache set up properly. I don't know what OS you're using, but it might be worth checking this link, written for Ubuntu, to make sure all is well: http://leoponton.blogspot.com/2010/05/getting-cakephp-up-and-running-on.html
I fixed the same problem.
if you are using windows 7 os, wamp server, cakephp 2.2.3. then
goto apache -> http.conf -> open -> search for mod_rewrite -> uncomment the line LoadModule rewrite_module modules/mod_rewrite.so
Now restart your server, now it should work fine.
Jerry, I think the issue is this. You have put the CakePHP folder in the root of localhost. I would propose that you create a virtual host pointing the myProject so the url becomes:
http://myProject/accounting
This may solve your problem. Be sure rewrite module is on. Also, when you point the virtual host to myProject, it should be the APP folder of the cakephp. If you want to run multiple projects off the same core, you can set them up like so:
/var/www/cake
/var/www/html/myProject
/var/www/html/myProject2
The /var/www/cake directory is where you drop the cake core. Under this directory you will have cake, app, plugins, vendors, etc. the myProject(2) directories will be the contents of the app directory.
Now, to get this to work, you need to go to /var/www/html/myProject/webroot/index.php and edit it to point to the cake directory in /var/www/cake. This will then load the core when rewrite points to index.php in webroot. You should be good to go!

Categories