Page 1 of 1

PrettyURLs - How do you configure the settings?

Posted: Tue Apr 11, 2023 7:21 am
by Dorian
Brand new user. I'm testing the waters because I'd like to migrate my blog away from Wordpress and flat-file CMSs have always intrigued me. Anyway, I've searched the wiki and the forums and I'm stumped at how to get PrettyURLs to work. My URLS contain .php and question marks and otherwise don't look pretty which tells me something isn't configured.

Re: PrettyURLs - How do you configure the settings?

Posted: Wed Apr 12, 2023 3:13 pm
by Dorian
A softaculous instance of of flatpress installed here (might be expired by the time someone visits) has URLs that look mostly identical to my installation. For example...

BLOG - softaculous.com/FlatPresssdgnspmxjy/?paged=1
ABOUT -softaculous.com/FlatPresssdgnspmxjy/static.php?page=about
CONTACT - softaculous.com/FlatPresssdgnspmxjy/contact.php

What specifically are the formatted URLs supposed to look like when this plugin is active?

Re: PrettyURLs - How do you configure the settings?

Posted: Wed Apr 12, 2023 3:55 pm
by WineMan
I'm getting an internal Server error when I click on the link.

Re: PrettyURLs - How do you configure the settings?

Posted: Wed Apr 12, 2023 4:07 pm
by Dorian
Looks like softaculous deletes their demo sites after about 30 minutes. If you want to install another demo and view the results, click here and to access the admin, the useraname/password is admin/password.

Re: PrettyURLs - How do you configure the settings?

Posted: Wed Apr 12, 2023 6:28 pm
by fraenkiman
Hello Dorian,

basically the PrettyURL plugin works quite well.

A blog entry can be reached as follows, depending on the settings:

Automatically

Code: Select all

https://frank-web.dedyn.io/index.php/2023/01/29/flatpress-13-andante-soll-veroffentlicht-werden/
Path Info

Code: Select all

https://frank-web.dedyn.io/index.php/2023/01/29/flatpress-13-andante-soll-veroffentlicht-werden/
HTTP Get

Code: Select all

https://frank-web.dedyn.io/?u=/2023/01/29/flatpress-13-andante-soll-veroffentlicht-werden/
Pretty

Code: Select all

https://frank-web.dedyn.io/2023/01/29/flatpress-13-andante-soll-veroffentlicht-werden/
For the plugin to work as expected, mod_rewrite must be installed on the web server.

Furthermore, the plugin should be allowed to create a new .htaccess file in the root directory. The content of this file then looks something like this:

Code: Select all

Options -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^([a-zA-Z0-9_-]+)/$ ./static.php?page=$1 [L]
RewriteRule ^.+/comments/$ ./comments.php [L]

RewriteRule ^(.+)/$ blog.php [L]

</IfModule>
There is an issue with an enhancement suggestion on Github via the PrettyURL plugin. It may be possible to create a rewrite rule in the .htaccess file.

I'll take a closer look in the days.

With best regards
Frank

Re: PrettyURLs - How do you configure the settings?

Posted: Thu Apr 13, 2023 4:31 am
by Dorian
Would it be complicated to make the URLs more closely match wordpress' /%postname%/ setting? In this case they would look similar to this...

https://frank-web.dedyn.io/flatpress-13-andante-soll-veroffentlicht-werden/

Rather than including the date portion...

https://frank-web.dedyn.io/2023/01/29/flatpress-13-andante-soll-veroffentlicht-werden/

Re: PrettyURLs - How do you configure the settings?

Posted: Sat Apr 15, 2023 11:04 pm
by fraenkiman
Hello Dorin,

the date in the URL belongs to the fixed permalink structure of FlatPress.

The process of removing the date from your permalinks is extremely common but can be detrimental if done incorrectly. It can negatively impact both SEO and Google search rankings for your FlatPress website.

I have successfully tested a redirect rule for the .htaccess file.

Code: Select all

RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(?!page/)(.+)$ https://your-website.ltd/$4
For the rule to work, you need to set the mode to "Pretty" in the PrettyURL plugin.

However, before this rule, you need to rewrite it so that /YYYY/MM/DD is removed from the URL.
With the rewrite I don't get a consistent result.

I have created a suggestion for improvement.

With best regards
Frank