does mod_rewrite output have to exist?

Posted by user788171 on Stack Overflow See other posts from Stack Overflow or by user788171
Published on 2012-09-20T21:35:57Z Indexed on 2012/09/20 21:37 UTC
Read the original article Hit count: 163

I am trying to use mod_rewrite to generate cleaner urls.

I have the following in my .htaccess

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^mypage.php$ https://%{HTTP_HOST}/mypage [R=301,L]

The objective is to go from https://mysite.com/mypage.php to https://mysite.com/mypage

This gives me a 404 error. I don't actually have the directory mypage/ existing. But from my understanding, I don't need to actually have mypage for mod_rewrite to work. What am I doing wrong?

© Stack Overflow or respective owner

Related posts about mod-rewrite

Related posts about http-status-code-404