A
A
Andrew2014-01-25 15:45:09
PHP
Andrew, 2014-01-25 15:45:09

How to display the content of the page name.py from the cgi-bin section when visiting the site.com/name page?

I write cgi scripts and put them in the cgi-bin category on the hosting. Is it possible to somehow make it so that when you visit, say, the site.com/name page, and the page displays the contents of the page name.py from the cgi-bin section?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
ruslanbat, 2014-01-26
@ruslanbat

read mod_rewrite
for this task, try to create such a
.htaccess file in the root

RewriteEngine on
RewriteRule ^(.*)$ cgi-bin/$1.py [L,QSA]

should open on request
site.com/name -> site.com/cgi-bin/name.py
site.com/test -> site.com/cgi-bin/test.py

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question