Reputation: 387
I wanted to do a simple .htaccess
redirect, but I can not make it work.
RewriteEngine On
Redirect about.html article.php?id=about [L]
The script and .htaccess
is living in a subdirectory: domain.tld/directory/
Where is my error?
Upvotes: 0
Views: 20
Reputation: 7476
You are mixing the rules of mod_alias and mod_rewrite,
If you want only redirect with mod_rewrite use below in directory/
,
RewriteEngine On
RewriteRule ^about.html$ article.php?id=about [R=301]
And if you want to rewrite, assuming about.html is not exists.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^about.html$ article.php?id=about [L]
Upvotes: 1