How to hide “cgi-bin”, “.py”, etc from my URLs?

后端 未结 6 1971
没有蜡笔的小新
没有蜡笔的小新 2021-02-01 08:49

Brand new to web design, using python. Got Apache up and running, test python script working in cgi-bin directory. Get valid results when I type in the URL explicitly: \".../

6条回答
  •  孤城傲影
    2021-02-01 09:30

    You'll find the ScriptAlias directive helpful. Using

    ScriptAlias /urlpath /your/cgi-bin/script.py
    

    you can access your script via http://yourserver/urlpath.

    You also might want to look into mod_passenger, though the last time I used it, WSGI was kind of a "second-class citizen" within the library—it could detect WSGI scripts if it were used to serve the whole domain, but otherwise there are no directives to get it to run a WSGI app.

提交回复
热议问题