Static pages and URL rewrite

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Lorand
Regular
Posts: 13
Joined: Tue Mar 29, 2016 11:57 am

Static pages and URL rewrite

Post by Lorand »

When I activate the mod_rewrite, none of my static pages work (I have 2 pages created via Static Page plugin and 1 Contact Form). Is there a way to force their URLs not being rewritten?
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static pages and URL rewrite

Post by Timbalu »

Please show us your examples on your page.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Lorand
Regular
Posts: 13
Joined: Tue Mar 29, 2016 11:57 am

Re: Static pages and URL rewrite

Post by Lorand »

Currently I have two blogs, the setups are almost identical (except for the skins):
http://psih.ro/ (without mod_rewrite)
http://nitsch.ro/ (with mod_rewrite)
Both are working great with static pages (accesible thru navigation bar) without mod_rewrite, and in both cases the static pages won't work in mod_rewrite mode (the startpage is loading instead).
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static pages and URL rewrite

Post by Timbalu »

Thanks.
Which version of staticpages is running and what are the defined permalinks?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Lorand
Regular
Posts: 13
Joined: Tue Mar 29, 2016 11:57 am

Re: Static pages and URL rewrite

Post by Lorand »

The version is 4.09 and the permalinks are:
/index.php?/pages/eletrajz.html
/index.php?/pages/inmemoriam.html
(that's for http://nitsch.ro for which the mod_rewrite is enabled)
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static pages and URL rewrite

Post by Timbalu »

When you know that mod rewrite is working well on your site, you should rename them from

Code: Select all

/index.php?/pages/eletrajz.html
/index.php?/pages/inmemoriam.html
to

Code: Select all

/pages/eletrajz.html
/pages/inmemoriam.html
Could you please additionally paste the current content of your .htaccess file to see and compare it has all directives needed for staticpages and mod_rewrite.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Lorand
Regular
Posts: 13
Joined: Tue Mar 29, 2016 11:57 am

Re: Static pages and URL rewrite

Post by Lorand »

The rewrite is working well on other pages, but the static pages aren't working even renamed.

Here's my .htaccess:

Code: Select all

# BEGIN s9y
ErrorDocument 404 /index.php
DirectoryIndex /index.php
php_value session.use_trans_sid 0
php_value register_globals off
Options -MultiViews

RewriteEngine On
RewriteBase /
RewriteRule ^serendipity_admin.php serendipity_admin.php [NC,L,QSA]
RewriteRule ^((archives/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+\.html)/?) index.php?/$1 [NC,L,QSA]
RewriteRule ^(authors/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)\-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/authors/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(categories/([0-9;]+)\-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^archives([/A-Za-z0-9]+)\.html index.php?url=/archives/$1.html [NC,L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)?$ index.php?url=admin/ [L,QSA]
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(plugin|plugin)/(.*) index.php?url=$1/$2 [L,QSA]
RewriteRule ^search/(.*) index.php?url=/search/$1 [L,QSA]
RewriteRule ^comments/(.*) index.php?url=/comments/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css)$ index.php?url=/$1 [L,QSA]
RewriteRule ^(serendipity\.js|serendipity_admin\.js)$ index.php?url=/$1 [L,QSA] 
RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
#RewriteCond %{REQUEST_URI} !-U
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]

<Files *.tpl.php>
    deny from all
</Files>

<Files *.tpl>
    deny from all
</Files>

<Files *.sql>
    deny from all
</Files>

<Files *.inc.php>
    deny from all
</Files>

<Files *.db>
    deny from all
</Files>

# END s9y
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static pages and URL rewrite

Post by Timbalu »

Hm, that looks OK. [Normally!]

Since also your entries entrypaging does not work, and you get the hu lang @define('NO_ENTRIES_TO_PRINT', 'Nincs mit megjeleníteni'); note, I do think you may have had played around with the permalink section in Configuration - Permalinks.
Is that true? What did you change there, if?

I also can see you are on a LiteSpeed server.
There may be some issues with LiteSpeed and mod_rewrite, since this normally works everywhere else fine.
Check the first ~10 sites for anything you can do to check modules, confirm the situation, check by rule, etc with LiteSpeed. I do not have any experience to help with it myself.
https://www.google.de/search?hl=de&sour ... uche&gbv=1
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static pages and URL rewrite

Post by Timbalu »

I think this last htaccess rule is the one in question for staticpages:

Code: Select all

RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]
I assume it is not reached, while another rule above, somehow (silently) dies away...
Your PHP and servers error.log files don't yield anything?

Btw your entrypaging is working well! My fault was I had an pages path part inbetween.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Lorand
Regular
Posts: 13
Joined: Tue Mar 29, 2016 11:57 am

Re: Static pages and URL rewrite

Post by Lorand »

Where can I find the error.log? Searched everywhere, but no luck...
Lorand
Regular
Posts: 13
Joined: Tue Mar 29, 2016 11:57 am

Re: Static pages and URL rewrite

Post by Lorand »

In the meantime I did a trick: copied the contents of static pages and made them new posts, hidden from the frontpage. So they work now. But have no clue how to do this with the contact form...
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static pages and URL rewrite

Post by Timbalu »

Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Lorand
Regular
Posts: 13
Joined: Tue Mar 29, 2016 11:57 am

Re: Static pages and URL rewrite

Post by Lorand »

It seems that I don't have access to any of those...
I'll contact the hosting company for this issue.
Lorand
Regular
Posts: 13
Joined: Tue Mar 29, 2016 11:57 am

Re: Static pages and URL rewrite

Post by Lorand »

The problem was suddenly solved by itself a couple of days ago. I didn't make any changes, and before contacting the hosting company about this issue, the static pages started working again. Hope they continue to work in the future...
Post Reply