TYPO3 v10.4.9 - Speaking URLs not working - url

I installed TYPO3 v10.4.9 with boostrap package and created a few custom pages to try things out. I noticed that the "speaking URLs" are not working and I have no idea why. Note that I am a total bigginer in TYPO3, so I'm probably missing something obvious.
Example:
We have a page called Photos. The URL created by "URL Segment" in Page module > "Edit page properties" is https://example.com/photos and the ID of the page is 84.
If I click on the view icon in the Page module, URL https://example.com/photos opens in the frontend and I get a message that says "Not Found - The requested URL was not found on this server".
On the other hand, if I type URL with ID in the browser manually, like so: https://example.com/index.php?id=84, it works perfectly fine. This problem is present for every page I create.
I have created site configuration. Below is the content of config.yaml:
base: 'https://example.com'
baseVariants: { }
errorHandling: { }
languages:
title: 'Example Site'
enabled: true
base: /
typo3Language: default
locale: en_US.UTF-8
iso-639-1: en
websiteTitle: ''
navigationTitle: English
hreflang: en-US
direction: ''
flag: us
languageId: '0'
rootPageId: 1
routes: { }
websiteTitle: ''
.htaccess
AddHandler application/x-httpd-php74 .php
##__HCP_END__##
# Anything after the comment above is left alone
Please help. What am I missing here?
If I should paste some more data to help resolve the problem, please let me know. Thank you in advance.

I found a solution. I copied contents of
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess
to .htaccess and now it works perfectly.

Maybe the .htaccess is missing in the root of your installation.

Related

Custom protocol for Docusaurus

We want to serve a Docusaurus-build with Electron.
For this we are using a custom protocol that just serves the files to the Electron-Browser.
The Problem is, the Javascript that is running in the static-html build of the Docusaurus app just wont accept the url (at least that is what we think)
If we serve "doc://doc/docs/intro/index.html" it pops up for a second and afterwards the "Page Not Found"-page is shown - because the javascript does that.
Our url is "doc://doc" and our baseUrl is "/" and we can not figure out how to stop the Javascript from chaning the currently loaded page to the Page not found one.
(We disabled the Javascript and if it is disabled that error does not appear)
The problem was Electron...
You have to give the custom protocol privledge with this:
protocol.registerSchemesAsPrivileged([
{
scheme: 'doc',
privileges: { secure: true, standard: true },
},
]);
So it has actually nothing to do with Docusaurus.

AWS QuickSight rails integration authorization code error

I have a rails application that needs to add QuickSight. Found that for these purposes it is necessary to use the get_dashboard_embed_url method. This method returns me the URL, but following it (manually, through an iframe tag) I get this error text
Embedding failed because of invalid URL or authorization code. Both of these must be valid and the authorization code must not be expired for embedding to work.
Where can I find the authenticate code? How can I get it? Thanks for your help
This is how i fetch the url
credential_options = {
client: Aws::STS::Client.new(region: ENV['AWS_REGION']),
role_arn: ENV['QUICK_SIGHT_ROLE_ARN'],
role_session_name: self.user_email
}
assume_role_credential = Aws::AssumeRoleCredentials.new(credential_options)
qs_client = Aws::QuickSight::Client.new({
credentials: assume_role_credential,
region: ENV['AWS_REGION']
})
begin
qs_client.register_user({
identity_type: 'IAM', # accepts IAM, QUICKSIGHT
email: self.user_email,
user_role: 'READER', # accepts ADMIN, AUTHOR, READER, RESTRICTED_AUTHOR, RESTRICTED_READER
iam_arn: ENV['QUICK_SIGHT_ROLE_ARN'],
session_name: self.user,
aws_account_id: ENV['AWS_ACCOUNT_ID'],
namespace: 'default'
})
rescue
end
options = {
aws_account_id: ENV['AWS_ACCOUNT_ID'],
dashboard_id: ENV['QUICK_SIGHT_DASHBOARD_ID'],
identity_type: 'IAM',
session_lifetime_in_minutes: 300,
undo_redo_disabled: false,
reset_disabled: false
}
qs_client.get_dashboard_embed_url(options, {}).embed_url
And how i try to display
iframe src=#url class='w-100 h-100' style='min-height: 500px;'
At the first, sorry for my weak english, but i hope that you'll understand what i mean
Ok, after completing these points, everything began to work for me. Also read "Underwater rocks", this is very important points list which will save you tons of time
Replace my code in question with this
def fetch_url # this method fetch embed dashboard url
credential_options = {
client: Aws::STS::Client.new(
region: ENV['AWS_REGION'],
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
),
role_arn: ENV['QUICK_SIGHT_ROLE_ARN'],
role_session_name: self.user_email # This is attr_accessor :user_email
}
assume_role_credential = Aws::AssumeRoleCredentials.new(credential_options)
qs_client = Aws::QuickSight::Client.new({
credentials: assume_role_credential,
region: ENV['AWS_REGION']
})
begin
qs_client.register_user({
identity_type: 'IAM', # accepts IAM, QUICKSIGHT
email: self.user_email,
user_role: 'READER', # accepts ADMIN, AUTHOR, READER, RESTRICTED_AUTHOR, RESTRICTED_READER
iam_arn: ENV['QUICK_SIGHT_ROLE_ARN'],
session_name: self.user_email,
aws_account_id: 'ENV['AWS_ACCOUNT_ID']',
namespace: 'default'
})
rescue
end
options = {
aws_account_id: ENV['AWS_ACCOUNT_ID'],
dashboard_id: ENV['QUICK_SIGHT_DASHBOARD_ID'],
identity_type: 'IAM',
session_lifetime_in_minutes: 300,
undo_redo_disabled: false,
reset_disabled: false
}
qs_client.get_dashboard_embed_url(options).embed_url
end
Go to Manage QuickSight panel https://your-quicksight-region(us-east-2 for example).quicksight.aws.amazon.com/sn/admin#users and click on "Manage permissions" button (button is placed above of the table with users)
On the new page click on "Create" button and select "Sharing dashboards" checkbox. Set the name of the permission, click on the "Create" button
In your controller action: #url = fetch_url # fetch_url - method from 1 point
Add to your view: iframe src=#url OR you can use a amazon-quicksight-embedding-sdk but for me the iframe works pretty well
Underwater rocks
Remember that dashboard url (which you are get with this method qs_client.get_dashboard_embed_url(options).embed_url) can be used only once, i.e. you can't open two browsers tabs with the same URL. When you are will pass this URL to iframe, this URL will cease to be working and you will no longer be able to use it in others browser windows or others iframe's
Add your app domain to whitelist domains on the QuickSight. You can do it in the Manage QuickSight panel https://your-quicksight-region.quicksight.aws.amazon.com/sn/admin#embedding
!!!IMPORTANT!!! if you are trying to embed dashboard to your localhost:your_server_port_number rails server, then you will always get the error message into the iframe (but if you go to this URL through the address bar of the browser, then you should see your dashboard (comment out / remove the iframe so it doesn't use the link, because every embedded dashboard url is disposable)). This is because localhost:your_server_port_number is not provided in the whitelist (Underwater rocks p.2). For resolving this issue and testing your work you can use ngrok (maybe it's available only for macOS, i'm not sure).
When you'll download the ngrok open your terminal and run command
$ ./path_to_ngrok_script/./ngrok http your_server_port_number
For me it's:
$ ~/./scripts/ngrok http 3000
After that do these 3 things for adding your work station to QuickSight whitelist:
In the terminal with ngrok copy generated domain which starts with
the https (i'll name it ngrok_domain), NOT WITH HTTP. For
example: https://047956358355.ngrok.io
Go to the Underwater rocks p.2 and add ngrok_domain
Open your browser and go to the path with iframe, but use ngrok_domain instead of localhost:3000. For example, your embedded dashboard path is localhost:3000/embed_dashboard. Change it to https://047956358355.ngrok.io/embed_dashboard
After all these steps all is start working for me. I'm sure that some of the points here are superfluous, but i'm really tired of working with this integration, so here you yourself decide what should be left and what should be removed.
I hope my answer helped at least someone

Adding Title to URL Meteor Iron Router

Currently I have
http://www.example.com/videos/videoId
In my iron router,
Router.route('/videos/:_id', { name: 'videoShowtemplate' }
I want to make my site more seo friendly so I was thinking of adding
the video title to the URL.
http://www.example.com/videos/videoId/videoTitle
can you tell me how i can do this? thank you very much in advance.
Go through the docs: https://github.com/EventedMind/iron-router/blob/devel/Guide.md
Keep the same route and just add /:slug to your params.
Do all your validations on _id
Router.route('/videos/:_id/:slug', {
template: 'videoShowtemplate'
}
use the following code to redirect to the site
in html
click here
or in js
Router.go('videoShowtemplate', {_id: id,slug: title});

PrestaShop $link -> getProductLink($product) gives incorrect URL

I'm generating my product links in custom ajax powered module with $link -> getProductLink($product)
it's generating a URL like http://example.com/prestashop/2-blouse.html
which is throwing an error saying
[Debug] This page has moved Please use the following URL instead:
http://example.com/prestashop/blouses/2-blouse.html
How do I avoid the same
Thanks
P.S: I'm using prestashop 1.6
Set _PS_MODE_DEV_ to false in config/defines.inc.php.
In Preferences > SEO & URLs
set disable friendly URLs and Save
set enable friendly URLs and Save
The .htaccess file will be refreshed and now it will not show you that message.

Yii framework CHtml::link error jump to a named anchor in another page

I'm use Yii Framework.
I have a named anchor <a name="projet">projet</a> in about.php page.
I've created a link in the index page to the named anchor in the about page like that :
<?php echo CHtml::link('MyLink',array('site/page','view'=>'about#projet')); ?>
But when I click on the link "MyLink", I have an error 404 response with this message :
The requested view "about#projet" was not found.
And in the url I have:
localhost/myApps/index.php?r=site/page&view=about%23projet
I checked default charset application is UTF-8. So I don't understand why my link isn't well encoded.
Someone can help me please?
try this:
echo CHtml::link('MyLink',array('site/page','view'=>'about', '#'=>'projet'));

Resources