Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My apache httpd.conf file has following

NameVirtualHost 11.91.91.97

<VirtualHost:11.91.91.97>
  ServerName creditrepair.com
  DocumentRoot /var/www/credit
  <Directory /var/www/credit >
    DirectoryIndex app.php
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    allow from all
   </Directory>
</VirtualHost>

In my credit folder I have .htaccess file which contain the following

< IfModule mod_rewrite.c >

 RewriteEngine On
 RewriteBase /creditrepair
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ app.php [QSA,L]
 RedirectMatch ^/$ /app.php/

< /IfModule >

What I want to achieve is that ipnum/credit/app.php/home is rewritten as ipnum/credit/home

I have enabled mod_rewrite.
It doesn't work and I have no idea why.

Any suggestions?

share|improve this question

1 Answer 1

May I suggest to change a couple of lines as follows:

< IfModule mod_rewrite.c >

 RewriteEngine On
 RewriteBase /creditrepair
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)/app.php/(.*)$ $1/$2 [QSA,L]

< /IfModule >

I haven't tested but it could work, basically what it should do is rewrite the URL taking everything before ($1 match) and after ($2 match) /app.php/ appending the query string as well.

share|improve this answer
    
Thanks for your valuable suggestion.but it doesn't work for me.i have a doubt how could it recognize the $1 and $2.i dont whether my .htacess is connecting to server or not –  bangari Jun 7 '13 at 2:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.