Nice extension, but one improvement would be awesome! To be able to style the HTML of redirect pages like 404 for example with uikit styling! Any uikit classes I applied don't worked somehow.

spqr/redirect: Add css sources to HTML-output
- Fosphatic Duke
- Thread is marked as Resolved.
-
-
That’s possible - as this HTML is directly set as response, please make sure you included the header with all css ressources.
-
you could simply copy the source from a specific page, edit it and paste it as 404 HTML-response.
-
you could simply copy the source from a specific page, edit it and paste it as 404 HTML-response.
But this won't apply any styles from own defined or uikit components! It needs extra inline styling then and it sucks, as you can hardly do it with all the viewport changes all in one line as you can imagine. I would like to have only one simple Image and one sentence as cover centered in height as some viewport changes to have a nice appearing, and exactly this is not really possible with the html function of this extension. The only way to have it without too much headache is to create an own page for that and use the url forwarding feature of the extension.
That's the code i use:
Code- <div class="uk-cover-background uk-position-relative" style="width:100%; height: auto; background-image: url(storage/system/404.jpg);">
- <img class="uk-invisible" src="storage/system/404.jpg" alt="404 Error" height="auto">
- <div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle">
- <div class="cover-style">
- Wir konnten die gesuchte Seite leider nicht finden!
- </div>
- </div>
- </div>
So to reach the same result i would have to style inline following classes additionaly: "uk-cover-background, uk-position-relative, uk-invisible, uk-position-cover, uk-flex uk-flex-center, uk-flex-middle"
Well it would be way easier have to style only additional stylings like in my case the class "cover-style" pretty easy with your assets extension. Unfortinately even those defined styles are not applied to the html function of the extension.
-
Well - even if that „sucks“ (don’t like this word
) there is no other possibility, as the extension does not know about any custom stylings. How could that be possible? To archive that the extension would have to crawl an „example page“ and modify the DOM. That would be a resource-killer.
You could grab a page in your frontend, show it’s source, copy it and modify the content. That works fine.
-
Well - even if that „sucks“ (don’t like this word
) there is no other possibility, as the extension does not know about any custom stylings. How could that be possible? To archive that the extension would have to crawl an „example page“ and modify the DOM. That would be a resource-killer.
You could grab a page in your frontend, show it’s source, copy it and modify the content. That works fine.
Roman I did copy the source code, but there is never a styling applied directly if it not an inline styling. About if there is an possibilty or not I can't tell a thing, if you say there is no, then there is no. If the only way is to do inline styling then you can't reach a clean result that easy. Even the hardway i never saw viewport changes in inline styling.
Probably you know an other way to show source view with applied styling directly, i do only know the right click method.
-
You can view the full source with ctrl + u in most browsers.
You need to include all the html-head-information
-
You can view the full source with ctrl + u in most browsers.
You need to include all the html-head-information
Well ctrl + u is exactly the combination doing the same trick as right klick and show page sourcecode.
But thanks for the tip including the head section did the trick. Didn't knew that one. But it loads then way more things then i need right?
-
That‘s possible. But in your case you‘d to remove the unnecessary things by yourself - that‘s something the extension can not do.
-
That‘s possible. But in your case you‘d to remove the unnecessary things by yourself - that‘s something the extension can not do.
I see but it seems to work now as i imagined before installing the extension, thanks roman
-
-
Looks fine
Btw: Redirecting 404 pages using 301/302 can possibly have bad impact on SEO and can cause problems in the backend.
I highly recommend setting up an 404 page (HTML!!) and look after the statistics from time to time to generate redirects.
-
What should i setup instead? There are only 300 something available....
-
You can not redirect with 404. You can only redirect with 301/302.
The best way is to handle notfound exceptions with an HTML response and HTTP status code 404.
-
You can not redirect with 404. You can only redirect with 301/302.
The best way is to handle notfound exceptions with an HTML response and HTTP status code 404.
Okay and how to set it up with the extension?
-
-
Well I added a picture as well above in the post so as I see it is configured same way what your screenshot shows.
My point was how to prevent Redirecting 404 pages using 301/302 redirection method.
-
C'mon... Be more precisely... What do you expect? What exactly does not work as expected?
-
C'mon... Be more precisely... What do you expect? What exactly does not work as expected?
You have wrote:
QuoteBtw: Redirecting 404 pages using 301/302 can possibly have bad impact on SEO and can cause problems in the backend
and I just wanted to know how to prevent this not seo friendly redirection....
-
Sorry, but I still don't get your point.
I just wrote what you have to do to prevent it.
Go to settings, enable "not found handler", choose "HTML" and "404" and everything is fine...