1

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?

1 Answer 1

0

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.

1
  • 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, 2013 at 2:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .