Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
visualizer-synthesis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Owen Graham
visualizer-synthesis
Commits
7681ac2c
Verified
Commit
7681ac2c
authored
3 years ago
by
Owen Graham
Browse files
Options
Downloads
Patches
Plain Diff
Set up redirect to new CGI script name
parent
d002d7d3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/.htaccess
+1
-0
1 addition, 0 deletions
htdocs/.htaccess
htdocs/visualizer.py
+15
-0
15 additions, 0 deletions
htdocs/visualizer.py
with
16 additions
and
0 deletions
htdocs/.htaccess
+
1
−
0
View file @
7681ac2c
Options
+ExecCGI
Options
+ExecCGI
AddHandler
cgi-script .py
<
FilesMatch
"^-$"
>
<
FilesMatch
"^-$"
>
SetHandler
cgi-script
SetHandler
cgi-script
</
FilesMatch
>
</
FilesMatch
>
...
...
This diff is collapsed.
Click to expand it.
htdocs/visualizer.py
0 → 100755
+
15
−
0
View file @
7681ac2c
#!/usr/bin/env python3
"""
Redirect to the new CGI script name,
"
-
"
.
"""
import
os
from
pathlib
import
PurePosixPath
request_script
=
PurePosixPath
(
os
.
getenv
(
'
SCRIPT_NAME
'
))
request_uri
=
PurePosixPath
(
os
.
getenv
(
'
REQUEST_URI
'
))
relative
=
request_uri
.
relative_to
(
request_script
)
target_script
=
request_script
.
with_name
(
'
-
'
)
target
=
target_script
/
relative
print
(
'
Status: 308 Permanent Redirect
'
)
print
(
f
'
Location:
{
target
}
'
)
print
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment