Hello. My goal is to redirect a course url, but I am having trouble.
I am running httpd-2.4.6-45.el7.centos.4.x86_64 and moodle 3.3
I tried putting this in [docroot]/.htaccess:
DirectoryIndex index.php index.html index.htm
php_value memory_limit 40M
php_flag magic_quotes_gpc 1
php_flag magic_quotes_runtime 0
php_flag file_uploads 1
php_flag session.auto_start 0
php_flag session.bug_compat_warn 0
<IfDefine APACHE2>
AcceptPathInfo on
</IfDefine>
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^[my website ip address]$ [NC]
RewriteRule ^learn/course/index\.php?categoryid=13$ http://www.google.com [L,R=301,NC]
But that did nothing. So then I tried putting stuff in httpd.conf
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^/learn/course/index.php
RewriteCond %{QUERY_STRING} categoryid=17
RewriteRule (.*) https://www.google.com [R=301,L]
</IfModule>
But this does nothing either. I am wondering is it because /learn/course/index.php?categoryid=17 has queried string?