I installed Revolution 2.2.0-pl2 on an EC2 instance running an Ubuntu image. I activated the rewrite module. I enabled mod_rewrite in a .htaccess file and added:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# Block access to "hidden" directories whose names begin with a period. This
# includes directories used by version control systems such as Subversion or Git.
RewriteCond %{SCRIPT_FILENAME} -d
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule "(^|/)\." - [F]
# Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# sample file has ?q=$1 but that doesn't work
RewriteRule ^(.*)$ index.php?id=$1 [L,QSA]
# Rewrite "www.example.com -> example.com"
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>
I have also tried a file that consisted only of:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?id=$1 [L,QSA]
And I have tried using `q` rather than `id`. In all cases, I get a 404 page.
The resource with id 4 is published with the alias "test-page" and clicking "view" loads
http://example.com/test-page.html in the address bar, as you would expect, but the page is 404.
Likewise, if I go to
http://example.com/index.php?id=4 I am redirected to
http://example.com/test-page.html and a 404 "The requested URL /test-page.html was not found on this server."
The `Use Friendly Urls` option is set to "yes". But always, I get a 404. I have used Modx Revolution in the past without difficulties and as far as I can tell, I haven't done anything differently this time, yet something is wrong.