Hello,
I am trying to put a rewrite rule on .htaccess, but it's not working. Do I need to make a change to php.ini to enable rules to be added to .htaccess?
Thanks in advance,
John
Hello,
I am trying to put a rewrite rule on .htaccess, but it's not working. Do I need to make a change to php.ini to enable rules to be added to .htaccess?
Thanks in advance,
John
No, php.ini is specifically related to PHP, .htaccess is Apache.
What are your rules? If it is something like mod_rewrite, then you may need to enable the mod_rewrite module in Apache.
You have to edit your apache vhost file and allow the .htaccess file to override the settings. This is done by the
AllowOverride
statement in the directory part of the vhost file. And maybe enabling the mod_rewrite.
No, .htacces
is completely independent of PHP. It is a apache configuration file to modify the configuration for the folder of the .htaccess
file.
To enable Rewriting in your .htaccess
RewriteEngine On
To do so you need to enable mod_rewrite in your apache configuration.
UPDATE:
You don't need the above Code in the .htaccess
file if you have the following somewhere in your apache config:
<IfModule mod_rewrite.c>
RewriteEngine on
</IfModule>