Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 30th December 2006, 06:25
H0unter H0unter is offline
Junior Member
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default mod_rewrite and php as a CGI

Hello everybody!! !!

How r u????

Ive just arrived !! my first post !!

Hope u can help me!!

I have a hostinga nd im using a php as a cgi , i have problems with a mod_rewrite , dont work :S! dont know why :S!! im a little noob in this thing , ive heart that rewrite is diferents when php is installed as a CGI , can give me a hand?? please!

RewriteEngine on
RewriteBase /

RewriteRule ^show\.php/(.*)$ show2.php?img=$1 [L]
RewriteRule ^out\.php/([a-z]{1})(.*)$ out2.php?$1=$2 [L]
RewriteRule ^view\.php/(.*)$ view2.php?img=$1 [L]
RewriteRule ^image\.php/([a-z]{1})(.*)$ images2.php?$1=$2 [L]
RewriteRule ^gallery/([0-9]+)-([^/]*)/(.*)$ gallery.php?gal=$1&img=$3 [L]
RewriteRule ^view/([0-9]+)-([^/]*)/(.*)$ gallery_body.php?gal=$1&img=$3 [L]

Here is the httacces!!

Thanks for your time and help!!

PSD: im peruvian and dont speak english T_T!! sorry if u cant undertand me veru wel T_T!!

Cyas

Att
Hounter
Reply With Quote
Sponsored Links
  #2  
Old 31st December 2006, 19:58
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

What exactly doesn't work? Any error messages? Any errors in Apache's error log?
__________________
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 31st December 2006, 20:08
H0unter H0unter is offline
Junior Member
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello!!

Thanks alot!!!! for ur help!!! and time!

Look:

I have this link --->

http://www.imagehost123.uni.cc/out.p...sidente6zw.jpg

and want to convert to:

http://www.imagehost123.uni.cc/out.p...sidente6zw.jpg


ive used:

RewriteRule ^out\.php/([a-z]{1})(.*)$ out2.php?$1=$2 [L]

whant is wrong??

No show me any errors :S

Thanks for ur help!!!
Reply With Quote
  #4  
Old 1st January 2007, 20:15
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

You could use something like this:

Code:
<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ /out2.php?i=$1 [L,QSA]
</IfModule>
You'd then use
http://www.imagehost123.uni.cc/out.php/32_presidente6zw.jpg instead of http://www.imagehost123.uni.cc/out.php/i32_presidente6zw.jpg, and it would get converted to http://www.imagehost123.uni.cc/out2.php?i=32_presidente6zw.jpg.
__________________
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
  #5  
Old 2nd January 2007, 04:53
H0unter H0unter is offline
Junior Member
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

:O alots of thanks ,

But im noob T_T! the code that u posted , u have to put it in a httacces?

thanks again

Att

Hounter
Reply With Quote
  #6  
Old 3rd January 2007, 17:34
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
 
Default

Quote:
Originally Posted by H0unter
u have to put it in a httacces?
Yes, put it into an .htaccess file (and remove everything else from it).
__________________
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
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


All times are GMT +2. The time now is 16:39.


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