LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Apache Migration/Compatibility > [solved] Alternative to Multiveiws

Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2011, 06:37 AM
johneva johneva is offline
New Member
 
Join Date: Mar 2011
Posts: 3
Default [solved] Alternative to Multiveiws

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 NiteWave; 03-22-2011 at 07:58 AM..
Reply With Quote
  #2  
Old 03-21-2011, 11:35 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,390
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: %

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

Last edited by webizen; 03-21-2011 at 11:44 AM..
Reply With Quote
  #3  
Old 03-22-2011, 01:57 AM
johneva johneva is offline
New Member
 
Join Date: Mar 2011
Posts: 3
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 by johneva; 03-22-2011 at 02:03 AM..
Reply With Quote
  #4  
Old 03-22-2011, 04:05 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,293
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]
Reply With Quote
  #5  
Old 03-22-2011, 05:04 AM
johneva johneva is offline
New Member
 
Join Date: Mar 2011
Posts: 3
Ah thats seems to be working now cheers for your help with this.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:39 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.