I've a TYPO3 CMS 6.2.15 running with realurl and the following LocalConfiguration.php:
'FE' => array(
'pageNotFound_handling' => '/404/',
'pageNotFound_handling_statheader' => "HTTP/1.0 404 Not Found",
...
), ...
I've created a page called "404" and tested if I can call that page like page.ending/404/. It works. But now I try a non-existing page like page.ending/asdfasdf/ and get the default Apache Unauthorized page. Why is that?
At least I get the correct 404 header information but why does it not redirect to the 404 page?
You have to change the corresponding line to:
'pageNotFound_handling' => 'REDIRECT:<your-404-url>',
First check php function curl is enable or not in your php.ini file. if curl is disable then first enable this function.
Then use below code in your LocalConfiguration.php file.
'FE' => [
'pageNotFound_handling' => '/your-page-name/',
],
Related
just updated Typo3 V9 (already running nicely behind reverse proxy) to the latest patchlevel on a test server without reverse proxy.
After migrating back everything is working fine, but I can't login to the backend. It redirects me to the internal webserver domain e.g. local.app1:8099/typo3.
I have everything set up, standard for reverse proxy. What can it be?
LocalConfig:
'reverseProxyHeaderMultiValue' => 'first',
'reverseProxyIP' => '12.345.678.90',
'reverseProxyPrefixSSL' => '',
'reverseProxySSL' => '*',
'sitename' => 'Foo',
'systemLogLevel' => 2,
'systemMaintainers' => [
1,
],
Best
RK
Solution:
Strange it didn't came up elswere. We Finally found a working fix here (at least for our config):
https://forge.typo3.org/issues/91414
I tried a vue-lumen-tutorial with laravel-passport. All works fine for me except the LoginController (login by user and password).
I think its not a problem of the tutorial code, its more a server or laravel/lumen configuration problem. But i am not sure.
The code runs remote on a linux machine (18.04), apache server with Lumen (5.8.12) (Laravel Components 5.8.*) and with Passport.
The api endpoints are available but the /login endpoint gives a 404 Not found.
I found here some questions/answers concerning the index.php of lumen or .htaccess file. Just installed Lumen and got NotFoundHttpException . But it doesn't help me.
I am testing with Postman:
GET to https://domain/api/companies/ works fine,
POST to https://domain/api/oauth/token works fine, but
POST to https://domain/api/login gives a 404 Not found.
The route /login is ok.
...
return app()->version(); only for testing gives a request but i need the $tokenRequest:
...
return app()->dispatch($tokenRequest); => 404 Not found
...
error message:
(1/1) NotFoundHttpException
in RoutesRequests.php line 229
...
protected function handleDispatcherResponse($routeInfo)
{
switch ($routeInfo[0]) {
case Dispatcher::NOT_FOUND:
throw new NotFoundHttpException; <== 229
case Dispatcher::METHOD_NOT_ALLOWED:
throw new MethodNotAllowedHttpException($routeInfo[1]);
case Dispatcher::FOUND:
return $this->handleFoundRoute($routeInfo);
}
}
...
Maybe a proxy issue between /oauth/token and /login? What can i do?
LoginController here in row 45: https://github.com/aibim/vue-lumen-tutorial/blob/master/app/Http/Controllers/LoginController.php
I found the error. The APP_URL path .env was wrong. I
wrong: APP_URL=https://domain.de/public/
right: APP_URL=https://domain.de/
when i paste this link
http://localhost/wordpress/wp-json/wc/v2/products?consumer_key=ck_*******************&consumer_secret=cs_********************
it show for me this error message
{"code":"woocommerce_rest_cannot_view","message":"D\u00e9sol\u00e9, vous ne pouvez pas lister les ressources.","data":{"status":401}}
by the way the cosumers key & secret are correct
Your connection must be throw https
and add this lines to your woocommerce init :
{
....
verifySsl: false,
queryStringAuth: true
}
every post request require ssl
dublicate from this link
Ionic 3 WP-REST API Post request 401 (unauthorized) error
&
WooCommerce REST API "woocommerce_rest_cannot_view "
Here are 2 possible solutions:
Add the following variable in the index.php page of your WordPress installation (Worked for me on my localhost without having to restart the server):
$_SERVER['HTTPS'] = 'on'; //------> Add this line under the line that says: define( 'WP_USE_THEMES', true );
Set the environment variable in the .htaccess file when using Apache:
SetEnv HTTPS on
401 is unauthorized error
if key and secret are correct, it could be todo with SSL
other people report similar problems
https://github.com/woocommerce/woocommerce/issues/19649
Problem solved by adding this line below to the end of .htaccess file
All you need to add this line to .htaccess , this work with me
SetEnv HTTPS on
And make sure use OAuth 1.0 for Authorization
add false in end of creating RestAPI like this...
RestAPI rest = new RestAPI(URL, ConsumerKey, ConsumerSecret, false);
it should by "authorizedHeader"
answer from https://github.com/XiaoFaye/WooCommerce.NET/issues/211
None of the suggestions helped me, so I deleted my previous API credentials and created new ones. This made the change for me.
I don't want to say "just delete your credentials" as you have to make sure to not break any necessary connections, please note that! I'm just sharing my experience on this.
I want to use perl with Module LWP to get the XML info from Restful Webservice.
Here is the Code:
my $ua = LWP::UserAgent->new;
$ua->proxy(['http','https'],'http://proxy:3128');
$ua->default_header('Accept-Charset'=>'utf-8');
$ua->default_header('Accept'=>'application/*********; version=1');
my $url= 'https://user:password#mailbox.********.net/mailboxes/?emailaddress=name#domain.net';
print Dumper($ua->get($url));
It works always good for all the email address like .eu, .org or .net, except for the email address ends with .com. (For example: name#domail.com)
The error message is:
The following error was encountered while trying to retrieve the URL:
https://user#mailbox.******.net/mailboxes/?
Access Denied.
Access control configuration prevents your request from being allowed at this time.
Please contact your service provider if you feel this is incorrect.
Your cache administrator is *****#**.**
The corresponded Response HEAD:
'_headers' => bless( {
'connection' => 'close',
'client-response-num' => 1,
'date' => 'Wed, 19 Nov 2014 15:53:45 GMT',
'x-squid-error' => 'ERR_ACCESS_DENIED 0',
'client-peer' => '****:3128',
'content-length' => '3502',
'client-date' => 'Wed, 19 Nov 2014 15:53:45 GMT',
'content-type' => 'text/html',
'mime-version' => '1.0',
'title' => 'ERROR: The requested URL could not be retrieved',
'server' => 'squid/3.1.12',
'x-cache' => 'MISS from proxy',
'x-cache-lookup' => 'NONE from proxy:3128'
}, 'HTTP::Headers' ),
I have tested with SoapUI and curl, they didn't meet this problem. That means .com works also with SoapUI and cuil. Only in perl with LWP, it gets problem.
Anyway when I added a dummy parameter like
https://**/mailboxes/?emailaddress=name#domain.com&foo=bar at the end of the link, it works.
I have no idea, if it's a bug in LWP or maybe some incompatible issue between LWP and Proxy Setting.
Access Denied.
Access control configuration prevents your request from being allowed at this time.
Please contact your service provider if you feel this is incorrect.
...
'x-squid-error' => 'ERR_ACCESS_DENIED 0',
There is an ACL in the proxy you use which denies your request.
If you have access to the proxy configuration check there, otherwise contact you cache administrator with your problem.
I am trying to implement the Yii2 RESTful Web Service API as described in the guide. I am trying it using the advanced application template. The problem is simply that all I get are 404 errors when I try to access the service. I wanted to start out trying something simple so I was simply going to use a country table and associated ActiveRecord class to try it out, here's the code:
This is in the components configuration in frontend/config/main.php :
'urlManager' => [
'enablePrettyUrl' => true,
'enableStrictParsing' => true,
'showScriptName' => false,
'rules' => [
['class' => 'yii\rest\UrlRule', 'controller' => 'country'],
],
],
'request' => [
'parsers' => [
'application/json' => 'yii\web\JsonParser',
]
]
This is the code in frontend/controllers/CountryController.php :
namespace frontend\controllers;
use yii\rest\ActiveController;
class CountryController extends ActiveController
{
public $modelClass = 'common\models\Country';
}
All of my ActiveRecord models like country are in common/models.
I used the following to try it:
curl -i -H "Accept:application/json" "http://myfrontendapp.loc/country"
This is the output I get:
HTTP/1.1 404 Not Found
Date: Fri, 31 Oct 2014 22:46:50 GMT
Server: Apache
Content-Length: 205
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /country was not found on this server.</p>
</body></html>
I have spent many hours on this. I have adjusted the setting, read documentation, and alot more without any success. If anyone can see what the problem is please let me know, thanks!!
You're hit by the default UrlRule behavior of pluralizing class names: in line with common REST conventions, it's smart enough to turn a controller named country into a pluralized route named /countries.
Try to GET http://myfrontendapp.loc/countries and it'll most likely work fine. This also goes for all other routes created by UrlRule, e.g. GET /countries/12345
Or, if you want to disable this behavior you can set UrlRule's $pluralize to false. Check http://www.yiiframework.com/doc-2.0/guide-rest-routing.html for more information.
According to yii2 rest standards while running your application you have to very specific with your URI i.e. as you are running the application for country so while running pluralize it so while running you should run as http://myfrontendapp.loc/countries.
But still you want country only then in your main.php under your urlmanager type 'controller'=>['c','country']. And if your problem still persists then you need to check your dir structure... It should be yii dir
api, backend, frontend under api their should be config, modules inside moudles --v1 and inside v1-- countrollers and models.
etc.
This will surely resolve your issue...
Try this:
In advanced/api/web/index.html add require(__DIR__ . '/../../common/config/bootstrap.php'); instead of require(__DIR__ . '/../../common/config/aliases.php');
In advanced/common/config/bootstrap.php add Yii::setAlias('api', dirname(dirname(__DIR__)) . '/api');
Look through this tutorial
And make sure your GET request is correct. Remove 'api/web' from reqesst line. Just use v1/countrys
Have you placed
.htaccess
in the folder, if not create the
.htaccess
with the following content
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
Or you can check the request with the following url once, as you are using advanced templaet
curl -i -H "Accept:application/json" "http://myfrontendapp.loc/frontend/web/index.php?r=countries"
One more thing to remember folder names are also case-sensitive while declaring namespaces, so please check the folder names as well.