Tutorial by Examples

In this example, we rewrite url's of the form http://example.com/topic/id-seoname to a php script that takes an id as input. This example expects the rule to be in "per-directory" context. RewriteEngine on RewriteRule ^topic/([0-9]+)-[^/]*/?$ /topics.php?id=$1 [L] In this example, t...
To match a query string, a condition must be added to the RewriteRule. This is done by putting RewriteCond directives before the corresponding rule. In the following example we dynamically internally rewrite an old url to a new url. RewriteCond %{QUERY_STRING} ^name=([^&]*)$ RewriteRule ^oldsc...

Page 1 of 1