TYPO3 - HTTPS Migration - https

I'm running a website under TYPO3 6.2 and follow this tutorial in order to migrate my website on HTTPS. For now I got success with :
following typoscript configuration on the root page :
config.absRefPrefix = auto
config.baseURL >
following TSconfig on the root page :
TCAdefaults.pages.url_scheme = 2
.. and everything seem to work fine. But if I edit this parameter :
... website shuts down with infinite redirection loop (301 Moved Permanently). Why ? The result is the same (infinite loop) if I execute this query :
UPDATE pages SET url_scheme = 2
...and same for BE if I make this change :
$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] = ‘2’;

You should not use the url_scheme field exactly because of issues like these. In fact this field was dropped with TYPO3v8. Any Page TSConfig related to url_scheme should be removed and you should run an SQL query to fix all existing pages.
Instead you should enforce HTTPS using a redirect in your .htaccess.
Infinite loops like these are usually caused by redirects performed both by TYPO3 and your webserver:
You request the site with HTTP.
TYPO3 redirects to HTTPS
Your webserver redirects to HTTP
Repeat 2. and 3.
For this reason you should also check your existing redirects, e.g. for enforcing www. in your domain.

Related

How to call sitemap.xml in codeigniter application

i have added sitemap.xml file to my codeigniter project.
And i call it on my localhost like that : http://localhost/demo/sitemap.xml
it runs without any issue.
But when i run it on live server http://example.com/demo/sitemap.xml
it says 404 page not found.
What is issue ?
you need to add below things in your config/routes.php file
$route['sitemap\.xml'] = 'demo/sitemap'; // your navigation path i.e. your controller_name/function_name

Allow URLs with Dashes on azure websites

I am trying to make an SEO friendly link for a downloads page
using codeigniter hosted on Azure Websites, now this is working:
www.example.com/downloads/viewfile/34
now when i generated this link :
www.example.com/downloads/viewfile/my-nice-file-name-34
the Url rewrite works great locally on a WAMP server, but when deployed to the remote (Azure Webites IIS ?) it gives the error:
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
I believe that the cause is: dash symbols are not allowed on IIS but is there a way arround ?
After all, i found out that its not the dash symbols that are causing the problem, but the words in the url itself
like yesterday i had www.example.com/downloads/viewfile/example-file-34
to some reason, having your domain-name in the url segments makes that error apear, so i simply replaced "mydomain" into nothing before generating the Url segment
$fileName = str_replace('mydomain','',$fileName);
return url_title($fileName.$fileId);
Now the same link above is www.example.com/downloads/viewfile/file-34 and its working fine.
i also noticed that same behavior is experienced when using some words like : ajax, json.
I hope this would be helful to somone.
In your routes.php file
Find
$route['translate_uri_dashes'] = FALSE;
Replace with
$route['translate_uri_dashes'] = TRUE;
You may need to look also into
URI Routing Codeigniter 3
http://www.codeigniter.com/user_guide/general/routing.html
Codeigniter 2 URI Routing
http://www.codeigniter.com/userguide2/general/routing.html

CodeIgniter returns 404 for all routes but works

I have strange problem with CodeIgniter and routing system and can't find solution for it, so: I have several routes such as
'forum/(:num)'
=> 'forum/category/$1',
'forum/(:num)/(page:any)'
=> 'forum/category/$1/$2',
and them works, but return 404 code in header.
I mean I don't get 404 page, correct HTML returns and page's content displays correctly for my forum's categories. But I'm getting 404 in header (Network tab in Firebug), so I can't work with POST data correctly.
If I request /forum/ - 200 Ok returns, but when I trying to get routed page, I get right page, but with 404 Not Found.
I'm using PHP5.4+Apache2 on Linux host, if it will help You to give me solution.
I've found solution! Maybe it will save someone's time.
Problem wasn't in CodeIgniter, I've found solution in activation mod_rewrite. Yes, that worked, but wan't activated in Apache.
Just try to do
sudo a2enmod rewrite
and restart apache service after
sudo service apache restart
And all routed pages will return 200 Ok
None of these worked, but I did this instead:
At the end of my controller I put this:
$this->output->set_status_header('200');
and actually though that worked, the problem turned out to be a controller name that conflicted with a real directory name...

How can I rewrite URLs in the Zeus web server for Mobile useragent?

I need to redirect anyone with a mobile user agent to a file called mobile.php.
My web hosting provider, Net Registry uses the Zeus web server.
Here's the script I've written from my research
RULE_1_START:
# get the document root
map path into SCRATCH:DOCROOT from /
match IN:User-Agent into $ with iPad|iPod|iPhone|Android|s+Mobile
if matched then
set OUT:Location = /mobile.php
endif
RULE_1_END:
I used the instructions on my host's site.
I pasted that into their console and it has worked to do redirects. Net registry have some odd console thing that you submit and it takes 10 minutes to update the zeus server config (annoying as hell).
Anyway my issue is that it redirects me to the wrong location:
So if you visit the site, with a user agent string that contains ipad|ipod|android|\s+mobile then you will trigger it ()
It takes me here:
http://example.com.au/mobile.php,%20catalog/index.php
I can't work out how to fix that, or why that happens because at the moment this file exists:
http://example.com.au/mobile.php
as does this one:
http://example.com.au/index.php. Contents of this file are:
<?php header("Location: catalog/index.php");
Any ideas on how I can make this work more like an apache .htaccess url Rewrite?
the official Zeus documentation
Fixed it by changing
set OUT:Location = /mobile.php
to
set URL = /mobile.php
From the manual...
Using Request Rewrite Scripts
To use the request rewriting functionality, create a script in the Zeus Request
Rewrite Scripting Language. The script contains instructions telling the
Virtual Server how to change the URL or headers of requests that match specified criteria.
The Virtual Server compiles the script, and (if the rewrite functionality is
enabled) uses it every time it receives a request. It runs the commands in the
script, changing the URL if it matches the specified criteria. Once the script is
finished, the Virtual Server continues processing the resulting URL.Zeus Web Server 4.3 User Guide
142 Configuring URL Handling
When changing the URL, the rewrite functionality can only change the local
part of it, that is, the part of the URL after the host name. For example, if a
user requests http://www.myhost.com/sales/uk.html, the rewrite
functionality can only make changes to /sales/uk.html. This means that
you cannot use the rewrite functionality to change the request to refer to a
file on another Virtual Server.
For example, the following script illustrates how to change requests for any
HTML files in the /sales directory so that the user receives them from the
/newsales directory instead:
match URL into $ with ^/sales/(.).html
if matched set URL=/newsales/$1.html
The rewrite functionality can also change the HTTP headers that were received
with a request, and create new HTTP headers to be returned to the user. For
example, the following script changes the HTTP host header, so that a request
for www.mysite.com/subserver is redirected to the Subserver
www.subserver.mysite.com:
match URL into $ with ^/([^/]+)/(.)$
if matched then
set IN:Host = www.$1.mysite.com
set URL = /$2
endif

302 Redirect set by Magento, 9300 Crawling errors

I have a SEOMOZ Pro account, and after crawling we have 9300 Warnings, and 90% of them are because of 302 redirect errors.
It looks like its something with the compare feature.
URL:
http://goo.gl/Dg1jY
0 Errors
No errors found!
1 Warning
302 (Temporary Redirect)
Found 1 day ago
Redirects to
http://goo.gl/OcAqw
Description
Using a 302 redirect will cause search engine crawlers to treat the redirect as temporary and not pass any link juice (ranking power). We highly recommend that you replace 302 redirects with 301 redirects.
I had the same issue. You can change whether or not you want to redirect cookie-less users to "enable cookies" page, in System -> Configuration -> Web -> Browser capabilities detection -> Redirect to CMS-page if Cookies are Disabled
I disabled it, and then changed the source code (version 1.7.0.2) as follows:
app/code/core/Mage/Core/Controller/Response/Http.php
93c93
< public function setRedirect($url, $code = 302)
---
> public function setRedirect($url, $code = 301)
The Yoast Canonical extension should fix that for you. It sets a canonical URL for the compare URLs that point to the actual Product page.
If you've only got 1 store view, then consider disabling "Use SID on front end" - this should help some of your natural links considerable.
Canonical URLs are in the core from version 1.4 onwards - so don't install a 3rd party extension.
Also, consider disabling HTTPS on non-checkout/account pages - you are slowing down your site unnecessarily.
As a side note, you're missing a favicon and showing full server tokens ;)

Resources