LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache Webserver assistance in ScriptAlias / redirect (https://www.linuxquestions.org/questions/linux-newbie-8/apache-webserver-assistance-in-scriptalias-redirect-4175481557/)

gdizzle 10-21-2013 01:45 AM

Apache Webserver assistance in ScriptAlias / redirect
 
Hi All,
I am having trouble In Apache and was hoping you can help:

Code:

vim  /etc/httpd/conf.d/zzz_otrs.conf

ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"


When I put the full path this loads the page fine:

http://localhost/otrs/index.pl


I comment out the above syntax and place the next option:

Code:

vim  /etc/httpd/conf.d/zzz_otrs.conf

ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/index.pl"


This loads http://localhost/otrs/ and diverts to http://localhost/otrs/index.pl. So this loads the page fine.


However if I now type in the page http://localhost/otrs/index.pl this FAILS unless I use: http://localhost/otrs/

Is there a way to access the http page http://localhost/otrs/index.pl using both:

http://localhost/otrs/
http://localhost/otrs/index.pl

mod_rewrite???

Thanks

zhjim 10-21-2013 01:59 AM

Might try two ScriptAlias directives. One for

Code:

ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"
ScriptAlias /otrs/index.pl "/opt/otrs/bin/cgi-bin/index.pl"

Or maybe use the ScriptAliasMatch Directive.

Be advised that the order of ScriptAlias matters longest path should go first.

gdizzle 10-21-2013 04:22 PM

Thanks for your help zhjim however this gave the same result:

However If I use:

Code:

ScriptAlias /otrs/index.pl "/opt/otrs/bin/cgi-bin/index.pl"
ScriptAlias /otrs1/ "/opt/otrs/bin/cgi-bin/index.pl"

This works fine, if I change the script alias for example to a different alias aka /otrs1.

I will see if I can figure out ScriptAliasMatch Directive.

gdizzle 10-21-2013 05:32 PM

Apologies looks to bet better now damn Browser Cache argh!

Thanks for your help!

zhjim 10-22-2013 04:23 AM

:) Can't count how many times I tripped over it too. Guess thats those things that are not on the mind.


All times are GMT -5. The time now is 02:24 AM.