Announcement

#1 2015-02-04 06:06:18

travelsignposts
Member
2015-02-02
19

Rewrite rules for SEO friendly URLs on Litespeed server

Hi all,

My VPS runs on a Litespeed server. Multiview is not available on Litespeed, so it is necessary to use rewrite rules to achieve SEO friendly URLs.

My .htaccess file in my Piwigo home directory Is this:

Code:

#htaccess piwigo
AcceptPathInfo On

RewriteEngine On
RewriteCond %{REQUEST_URI} !.+php*
RewriteCond %{DOCUMENT_ROOT}/$1\.php -f
RewriteRule ^([^/]+)/?(.*)$ $1.php/$2 [L]

and I have a local config file as follows:

Code:

<?php
/* The file does not exist until some information is entered 
below. Once information is entered and saved, the file will be created. */
$conf['question_mark_in_urls'] = false;
$conf['php_extension_in_urls'] = false;
$conf['category_url_style'] = 'id-name';
$conf['picture_url_style'] = 'file';
?>

This successfully removes the .php from the URLs, and works fine except for where the URL changes to use "picture" instead of "index", when it produces a 404.

As I am new to Piwigo, I'm not quite clear where "picture.php" fits into the scheme of things, so am uncertain as to where I'm going wrong. Can anyone help me?

(It would be nice to remove the "index" and "picture" references completely, but I don't think this is possible in Piwigo)

Piwigo version: 2.7.3
Operating system: Linux
PHP: 5.4.27
MySQL: 5.5.33a-MariaDB
Graphics Library: External ImageMagick 6.2.8
Piwigo URL (currently behind maintenance wall): http://www.travelsignpostschina/destination/

Cheers,

Tony Page

Offline

 

#2 2015-12-30 19:22:12

michaelh99
Member
Texas
2014-08-19
46

Re: Rewrite rules for SEO friendly URLs on Litespeed server

Unfortunately the .htaccess changes didn't work for me.

So far, turning off php_extension_in_urls just results in a broken site

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact