views:

19

answers:

1

Hi,

I want to rewrite the url http://mydomain/myapp/fakefolder to http://mydomain/myapp/index.php

I tried the following rule but thats not working

RewriteEngine On
RewriteRule ^fakefolder$ index.php  

The .htaccess file is located inside myapp.

Kindly help

Thanks vineet

A: 

To begin with, your folder is not called vineetstore: it's called fakefolder.


The corrected rule works for me so I'd dare say your Apache installation is not configured to read .htaccess files in such location. You can easily test that: make a syntax error on purpose and see whether your site crashes.

Find your virtual host or site definition and make sure you have this directive:

AllowOverride All
Álvaro G. Vicario
yes changed it.. copy paste error :)
naiquevin
did you actually create the fakefolder in the root ? I actually want to avoid creating a folder and just rewrite the url to index.php. But in order to see if it works, I created the fakefolder directory and now it shows me 403 forbidden error. Thanks
naiquevin
I reproduced your exact set-up in a name based virtual host. Have you made the test I suggested?
Álvaro G. Vicario
I got it now. Even I created a vhost and tried it. Changed RewriteRule ^fakefolder$ index.php to RewriteRule ^fakefolder$ myapp/index.php and it is working now. Thanks
naiquevin