Reputation: 3951
I have an HTML file I want rewritten as a subfolder on the server.
http://www.example.com/kids-and-family/185-summer-camp.html
to be shortened to:
Is there an rewrite condition where I can make this happen in .htaccess?
Can I say if (/camp) then display /kids-and-family/185-summer-camp.html?
I have been looking for this but have not found anything.
Upvotes: 0
Views: 35
Reputation: 3917
in your .htaccess file, try this:
RewriteEngine on
RewriteCond %{REQUEST_URI} "/camp"
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{DOCUMENT_ROOT} /kids-and-family/185-summer-camp.html -s
RewriteRule ^$ /kids-and-family/185-summer-camp.html [L]
Upvotes: 0