I want to rewrite my url with htaccess, when URL contains a certain string.
Example:
My url : example.com/information
When "information" is in my url, I want to rewrite to my information.php file. Hope anyone can help me out.
I want to rewrite my url with htaccess, when URL contains a certain string.
Example:
My url : example.com/information
When "information" is in my url, I want to rewrite to my information.php file. Hope anyone can help me out.
Try this:
RewriteCond %{REQUEST_URI} !/information\.php$
RewriteRule information information.php [L]
This rule will rewrite any request that contains “information” in the URL path to information.php in the same directory.