view raw
Floris Floris - 7 months ago 60
Apache Configuration Question

.htaccess filename to url

I've been searching and cannot find an answer that suits my needs. It is a rather simple question I assume.

The point is that I need to rewrite my files to a name of my liking. For example I have, '' which I want to rewrite to

Thus far I had this, but that doesn't seem to work with multiple lines.

Rewriteengine on
rewriterule ^support account_ticket.php [L]
rewriterule ^account account_index.php [L]

So in short, I want my website to redirect /account to account_index.php and the other way around.

Thanks in advance!


I found the answer for those that are wondering. I had to put a RewriteCond before every RewriteRule.

So if I wanted to go to I'd have this:

RewriteCond %{REQUEST_URI} ^/account$ [NC]
RewriteRule ^account account_index.php [NC,L]

This means that /account is now linked to account_index.php.

Have a nice day!