Thanks for the reply Charlie.  

Can you give me any pointers as to how I would set this up, I don't have a 
lot of experience with Apache configuration - it's managed by our systems 
admins so I'm currently stuck with CGI at the moment.

I managed to get it working by using:
$ENV{SCRIPT_NAME} = "/dir/my_app/" in

Then in htaccess I have:
AddHandler cgi-script .pl
Options +ExecCGI

IndexIgnore *

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ script/$1 [L]

The code in my original question was based on the documentation in the 
Apache Deployment info here:  I really like 
Mojolicious but I find that some of the documentation can be confusing for 
someone that is relatively new to the framework.  I guess that this is what 
this group is for though.  Thanks again.

On Tuesday, 11 October 2016 15:13:15 UTC+1, Charlie Brady wrote:
> On Mon, 10 Oct 2016, StarX wrote: 
> > I've got a Mojolicious app running under CGI, but my css and js files 
> are 
> > not being served from the pubic directory. 
> ... 
> > My URLs appear correctly in the page source as /dir/my_app/css/file.css 
> and 
> > /dir/my_app/js/file.js but clicking them in the source just displays the 
> > entire page content rather than the css/js.  I'm not quite sure how to 
> > configure the rewrite correctly, can anyone help? 
> I think you should configure apache so that those files are served 
> directly by apache, rather than attempt to have your application executed. 

You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to