Forum Moderators: phranque
#
# GetSimple CMS htaccess ROOT file
# apache 2.4
#
# The following require certain allow overrides, if getting 500 error comment them out one by one
# can be resolved in apache httpd.conf to ensure security alternatives
# override charset
AddDefaultCharset UTF-8
# prevent directory listings
Options -Indexes
# Follow symbolink links, This is required for rewrites on some hosts
Options +FollowSymLinks
# Set the default handler.
DirectoryIndex index.php
# blocks direct access to the XML files - they hold all the data!
<Files ~ "\.xml$">
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>
<IfModule mod_access_compat.c>
Deny from all
</IfModule>
<IfModule mod_authz_core.c>
<IfModule !mod_access_compat.c>
Require all denied
</IfModule>
</IfModule>
</Files>
<Files sitemap.xml>
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_access_compat.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
<IfModule !mod_access_compat.c>
Require all granted
</IfModule>
</IfModule>
</Files>
# handle rewrites for fancy urls
<IfModule mod_rewrite.c>
RewriteEngine on
# Usually RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
</IfModule>
RewriteEngine on
RewriteRule ^firstPage\.html http://www.example.com/firstPage [R=301,L]
RewriteRule ^secondPage\.html http://www.example.com/secondPage [R=301,L]
# redirect 301 /firstPage.html http://www.example.com/firstPage
# redirect 301 /secondPage.html http://www.example.com/secondPage
[edited by: engine at 8:54 am (utc) on Apr 22, 2016]
[edit reason] please use example.com [/edit]
having things in the correct order. Everything is now good.
when you mentioned mod_alias, where you talking about the redirects? They were commented out but are now removed.
should become this
Deny from all
The exact name of the module doing the deed varies from one version to another, but the syntax of the directive is always the same so you don't really need to know it. But the Require all denied
syntax is new in 2.4 and can't be used earlier.