Jump to content

Recommended Posts

my .htaccess file contain this

========================

RedirectMatch hamza.html http://localhost/phpinfo.php

 

what i want it

when i load hamza.html page it will rediect me to over here

http://localhost/phpinfo.php.

 

 

and my .htaccess file is in same folder where hamza.html page is

present .

folder is in root

 

please tel me where i am wrong

Link to comment
https://forums.phpfreaks.com/topic/177417-simple-question-rediectmatch/
Share on other sites

  • 3 months later...

The .htaccess should be placed in the document root for the website.

Your apache configuration should allow .htaccess override.

i.e.

AccessFileName .htaccess
<Directory "/var/www/html">
AllowOverride All
</Directory>

 

by default allowing is enable or not for  .htaccess file.

can we enable it in php.ini

or

if i have many .htaccess files then evy time i have to

allow it by using tags u shown above.

 

Your apache configuration should allow .htaccess override.

i.e.

AccessFileName .htaccess
<Directory "/var/www/html">
AllowOverride All
</Directory>

This is information that has to be set in the httpd.conf file to enable you to achieve different things with a .htaccess file. The chances are if you don't have a dedicated server you cannot change these values, so unless your host has them enabled anyway you are out of luck. It seems that you are attempting to do it locally, if that is the 'end game' then you can change the httpd.conf file yourself. It's located in the conf folder of your apache directory. Assuming you installed XAMPP, WAMP, LAMP, MAMP or some such package though, they normally have that sort of thing set-up for you already.

 

NB: I quoted Neil because he posted the code, I know your aware where that information goes Neil, I was pointing out for the sake of the OP who seemed to misunderstand you.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.