<p>What <a href="https://craftcms.stackexchange.com/questions/11539/installing-moodle-to-a-craftcms-server#comment15983_11539">Damon</a> said is correct.  You'll need to modify Craft's public <code>.htaccess</code> file so that all requests to Moodle URIs go to it's public <code>index.php</code> file and requests to Craft URIs go to Craft's public <code>index.php</code> file.</p>

<p>Alternatively, you could keep them as two separate installations, which simplifies things.</p>

CC BY-SA 3.0
2015-09-23T06:37:12.600Z
I've moved Moodle (student-portal) out of the templates folder and into the base site directly under public_html. It worked but only if I use a specific address like  https://domain/student-work/index.php. After installation though moodle tries to link to other pages like "https://domain.com/home/database/public_html/student-portal/my" and I get another 404 error through craft. Is this still a htaccess problem? I'm not sure what code I am looking to change or add even with the site above as I have little experience in modifying the .htaccess files of a website.
JeffTalbot
CC BY-SA 3.0
2015-09-22T02:47:44.713Z
2015-09-22T02:47:44.713Z
Brad Bell
<p>I was wondering if anyone had any experience in installing Moodle to a server that already had a CraftCMS website installed onto it? I've followed the instructions on the <a href="https://docs.moodle.org/29/en/Installation_Quickstart" rel="nofollow">Moodle Installation Guide</a> (I put the Moodle files in the CraftCMS template folder) but when I get to the part where I go to <a href="http://domain/moodle" rel="nofollow">http://domain/moodle</a> to install it I get a 404 error. If I go to <a href="http://domain/moodle/install.php" rel="nofollow">http://domain/moodle/install.php</a> I get the install file but it doesn't work, I just get a string of text like the PHP isn't executing. I can't find any similar issue's on Moodle's forums so I think that this will have something to do with craft not allowing the PHP?</p>

CC BY-SA 3.0
2015-09-21T13:56:59.253Z
I don't have a specific answer, but what I think you need is something within the .htaccess file that looks for anything that is moodle specific.

By default, the .htaccess file is sending all requests through the index file (which is Craft) so Craft is trying to interpret your Moodle requests. Which, it has no idea what to do with.

Maybe something like this? http://coolestguidesontheplanet.com/redirecting-a-web-folder-directory-to-another-in-htaccess/
Damon
<routing><server><craft-features>
Installing Moodle to a Craft CMS server
# Installing Moodle to a Craft CMS server

(Asked by: username_0 on 2015-09-21)

I was wondering if anyone had any experience in installing Moodle to a server that already had a CraftCMS website installed onto it? I've followed the instructions on the [Moodle Installation Guide](https://docs.moodle.org/29/en/Installation_Quickstart) (I put the Moodle files in the CraftCMS template folder) but when I get to the part where I go to <http://domain/moodle> to install it I get a 404 error. If I go to <http://domain/moodle/install.php> I get the install file but it doesn't work, I just get a string of text like the PHP isn't executing. I can't find any similar issue's on Moodle's forums so I think that this will have something to do with craft not allowing the PHP?

**Tags:** routing, server, craft-features

> **Comments:**
> **username_1**: I don't have a specific answer, but what I think you need is something within the .htaccess file that looks for anything that is moodle specific.  By default, the .htaccess file is sending all requests through the index file (which is Craft) so Craft is trying to interpret your Moodle requests. Which, it has no idea what to do with.  Maybe something like this? http://coolestguidesontheplanet.com/redirecting-a-web-folder-directory-to-another-in-htaccess/  

---

## 1 answers

### Answer by username_2 on 2015-09-22. Score: 0 | Accepted answer

What [username_1](https://craftcms.stackexchange.com/questions/11539/installing-moodle-to-a-craftcms-server#comment15983_11539) said is correct. You'll need to modify Craft's public `.htaccess` file so that all requests to Moodle URIs go to it's public `index.php` file and requests to Craft URIs go to Craft's public `index.php` file.

Alternatively, you could keep them as two separate installations, which simplifies things.

> **Comments:**
> **username_0**: I've moved Moodle (student-portal) out of the templates folder and into the base site directly under public_html. It worked but only if I use a specific address like  https://domain/student-work/index.php. After installation though moodle tries to link to other pages like "https://domain.com/home/database/public_html/student-portal/my" and I get another 404 error through craft. Is this still a htaccess problem? I'm not sure what code I am looking to change or add even with the site above as I have little experience in modifying the .htaccess files of a website.  

---

