Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 2nd June 2012, 21:47
autogun autogun is offline
Member
 
Join Date: Sep 2009
Posts: 69
Thanks: 9
Thanked 5 Times in 5 Posts
Default Apache mod_rewrite - Regex explanation

Hello all,

This one is killing me, I was banging my head for several hours and couldn't solve it until I got some external help.

What I was trying to achieve is - Every request that is not calling index.php, robots.txt or resources folder to be rewritten to example.com/index.php/variable

On a development server, this worked as expected:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
But when I moved the code to my production server (running ISPConfig), the above didnt work because "?" had to be added:
Code:
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
Can maybe someone explain me, why?
I was lost here :-(
Reply With Quote
Sponsored Links
  #2  
Old 4th June 2012, 14:06
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

I could imagine that it has something to do with cgi.fix_pathinfo in your php.ini. I suggest you compare the setting on both servers.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 16th December 2012, 23:56
nababan nababan is offline
Junior Member
 
Join Date: Nov 2008
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

check your cgi exec configuration
__________________
Imzers - Indonesian mobile entertaiment media community
http://www.imzers.org
Reply With Quote
Reply

Bookmarks

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
sessions not being saved gavimobile General 6 15th January 2012 16:05
trying to install roundcubemail ressel Installation/Configuration 13 24th December 2009 21:13
problems with suexec gobokster Installation/Configuration 7 7th May 2009 14:33
CENTOS 5 Ping Problem gAnDo Server Operation 11 28th March 2008 21:58
Problem with the installation of Dokeos (LMS) in ISPConfig jofranco General 4 28th April 2006 01:45


All times are GMT +2. The time now is 06:19.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.