[solved] Alternative to Multiveiws

Discussion in 'Apache Migration/Compatibility' started by johneva, Mar 21, 2011.

  1. johneva

    johneva New Member

    Hi

    My host has changed to Litespeed from Apache but I am having trouble with my site now.

    I have used the basic rewrite rule found on this forum and that works great for certain URL's and not so great for others.

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

    But problem I am having is that works great on this

    http://www.best-butcher.co.uk/butcher-details/test/1

    but when it comes to

    http://www.best-butcher.co.uk/cp/rate-butcher/test/1

    Or any file in the cp directory that does not contain the file extension.

    It wont work for some reason. Can anybody help me out with this issue please?
    Last edited by a moderator: Mar 22, 2011
  2. webizen

    webizen New Member

    is the last part (i.e. test/1) always the parameters to the php script (i.e. butcher-details(.php) and rate-butcher(.php)) prior to that? there can be 0 (/) or multiple level directories (/cp/..), correct? if so, try something like the following: %

    Last edited: Mar 21, 2011
  3. johneva

    johneva New Member

    Thats worked great cheers but has made these types of URL stop working.

    http://www.best-butcher.co.uk/find-butcher
    EDIT (now working just added the old rewrite and using both your suggested one and the old one together)

    And also have urls like this not working.

    http://www.best-butcher.co.uk/cp/find-butcher
    EDIT (still not working)

    These work ok if I add the .php to the end as thats what the file is really called but of course have designed the site to work without file extensions and thats why this issue has come up.

    On Apache of course just turned multiveiws on and this was fine but now the hosting company has changed to Litespeed am having issues.

    Cheers
    John
    Last edited: Mar 22, 2011
  4. NiteWave

    NiteWave Administrator

    how about copy following rules to each sub folder's .htaccess which need multiviews?

    # Multiviews
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !\.php$
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^([^/]+)(/?)(.*)$ $1.php$2$3 [L]
  5. johneva

    johneva New Member

    Ah thats seems to be working now cheers for your help with this.

Share This Page