hamza Posted October 12, 2009 Share Posted October 12, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/177417-simple-question-rediectmatch/ Share on other sites More sharing options...
JonnoTheDev Posted October 12, 2009 Share Posted October 12, 2009 redirect 301 /hamza.html http://localhost/phpinfo.php Quote Link to comment https://forums.phpfreaks.com/topic/177417-simple-question-rediectmatch/#findComment-935480 Share on other sites More sharing options...
hamza Posted October 12, 2009 Author Share Posted October 12, 2009 can anyone give me very simple Redirectmatch running example so i can understand Quote Link to comment https://forums.phpfreaks.com/topic/177417-simple-question-rediectmatch/#findComment-935486 Share on other sites More sharing options...
JonnoTheDev Posted October 12, 2009 Share Posted October 12, 2009 redirectMatch is for pattern matching (regex). It is not what you need. Use the above post. See the apache docs for examples of redirectMatch http://httpd.apache.org/docs/1.3/mod/mod_alias.html Quote Link to comment https://forums.phpfreaks.com/topic/177417-simple-question-rediectmatch/#findComment-935489 Share on other sites More sharing options...
hamza Posted October 12, 2009 Author Share Posted October 12, 2009 okay thanks for the link but can you tel me .htaccess dir position C:\AppServ\www\rewriting practice\ 1.htaccess hamza.html Can you tell me both are in right place and i am not sure .htaccess is working with hamza.html ??? Quote Link to comment https://forums.phpfreaks.com/topic/177417-simple-question-rediectmatch/#findComment-935490 Share on other sites More sharing options...
JonnoTheDev Posted October 12, 2009 Share Posted October 12, 2009 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> Quote Link to comment https://forums.phpfreaks.com/topic/177417-simple-question-rediectmatch/#findComment-935493 Share on other sites More sharing options...
hamza Posted January 30, 2010 Author Share Posted January 30, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/177417-simple-question-rediectmatch/#findComment-1004029 Share on other sites More sharing options...
cags Posted January 30, 2010 Share Posted January 30, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/177417-simple-question-rediectmatch/#findComment-1004184 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.