I am having an issue with getting mod_rewrite rules working in .htaccess after moving them from the conf.d folder.
I do understand for performance sake that it would be wiser to leave it sitting there but I have folder serving php on the document root which I do not want these same rules applied to.
And here it is.. Any and all help would be greatly appreciated!
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/([^/]*)/(\d+)/? /index.php?p=$1&id=$2 [QSA,L]
RewriteRule ^/([^/]*)/([^/]*)/(\d+)/? /index.php?p=$1&s=$2&id=$3 [QSA,L]
RewriteCond %{REQUEST_URI} !/(manual|admin|awstats)
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^/([^/]*)/?([^/]*)/? /index.php?p=$1&s=$2 [QSA,L]
</IfModule>
Edited with additional config:
<Location "/admin/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE site.settings
#PythonDebug Off
</Location>
Alias /adminmedia/ "/usr/lib/python2.4/site-packages/django/contrib/admin/media/"
<Directory "/usr/lib/python2.4/site-packages/django/contrib/admin/media">
Options -Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
as astated by @Jason McCreary you can put your rewriteRules in a
<Directory>section. It will be limited to that directory only. The main advantage from aDirectoryversus a.htaccessis that you do not need to allow anything inAllowOverride. So that’s:use AllowOverride None)AllowOverride Nonein a<Directory />section, start on top of the filesystem)Now there are some difference on the rewrite Engine when used in
.htaccessfiles, you may need to play with rewriteBase for example.