So I've been tinkering. Apache's .htaccess
was redirecting my WWW client just fine (if there is no WWW present, 301 to the same URL with a WWW included), and it was redirecting things with file extensions (i.e. index.html
will redirect to index.php
). It's only URLs that are without an extension. It refuses to decipher them.
My current file:
RewriteEngine On
RewriteBase /
# Clean URL
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)/?$ $1.php [NS,L,R=permanent]
# Force WWW
RewriteCond %{HTTP_HOST} !^www\.thevgc\.net$
RewriteRule ^(.*)/?$ http://www.thevgc.net/$1 [NS,L,R=permanent]
I've been trying to figure this out all night long now. mod_rewrite
is enabled, and I had to create a symbolic link to /etc/apache2/mods-enabled/rewrite.conf
before actually making the file, which consists of the following:
RewriteEngine On
Thoughts on this dilemma of mine?