Skip to content

Commit

Permalink
nicer urls
Browse files Browse the repository at this point in the history
  • Loading branch information
joschahenningsen committed Jan 9, 2021
1 parent e993e11 commit 136a85f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?watch/(.*?)/?$ /watch.php?s=$1 [L]
RewriteRule ^/?video_only/(.*?)/?$ /video_only.php?s=$1 [L]
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN npm i --no-dev
FROM php:7.4-apache
RUN pecl install APCu-5.1.18
RUN docker-php-ext-enable apcu
RUN a2enmod rewrite

WORKDIR /var/www/html/
COPY ./ /var/www/html/
Expand Down
18 changes: 9 additions & 9 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ function constructLink($type, $link) {
$link = base64_encode($link);

if ($type == "comb") {
return '<a href="./watch.php?s=' . $link . '"><span class="material-icons md-dashboard"></span></a>';
return '<a href="./watch/' . $link . '"><span class="material-icons md-dashboard"></span></a>';
} else if ($type == "pres") {
return '<a href="./watch.php?s=' . $link . '"><span class="material-icons md-present_to_all"></span></a>';
return '<a href="./watch/' . $link . '"><span class="material-icons md-present_to_all"></span></a>';
} else if ($type == "cam") {
return '<a href="./watch.php?s=' . $link . '"><span class="material-icons md-videocam"></span></a>';
return '<a href="./watch/' . $link . '"><span class="material-icons md-videocam"></span></a>';
}
}

Expand All @@ -34,15 +34,15 @@ function constructLink($type, $link) {
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RBGreater</title>

<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="js/content_handler.js"></script>
<script src="/node_modules/jquery/dist/jquery.min.js"></script>
<script src="/js/content_handler.js"></script>

<!-- Library stylesheets -->
<link rel="stylesheet" href="node_modules/typeface-roboto/index.css">
<link rel="stylesheet" href="node_modules/@material-icons/font/css/all.css">
<link rel="stylesheet" href="/node_modules/typeface-roboto/index.css">
<link rel="stylesheet" href="/node_modules/@material-icons/font/css/all.css">
<!-- Custom stylesheets -->
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="/css/global.css">
<link rel="stylesheet" href="/css/index.css">
</head>

<body>
Expand Down
10 changes: 5 additions & 5 deletions video_only.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RBGreaterAgain</title>

<script src="node_modules/hls.js/dist/hls.min.js"></script>
<script src="/node_modules/hls.js/dist/hls.min.js"></script>

<!-- Library stylesheets -->
<link rel="stylesheet" href="node_modules/typeface-roboto/index.css">
<link rel="stylesheet" href="node_modules/@material-icons/font/css/all.css">
<link rel="stylesheet" href="/node_modules/typeface-roboto/index.css">
<link rel="stylesheet" href="/node_modules/@material-icons/font/css/all.css">
<!-- Custom stylesheets -->
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/video_only.css">
<link rel="stylesheet" href="/css/global.css">
<link rel="stylesheet" href="/css/video_only.css">
</head>

<body>
Expand Down
12 changes: 6 additions & 6 deletions watch.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $data["name"]; ?> | RBGreater</title>

<script src="node_modules/hls.js/dist/hls.min.js"></script>
<script src="/node_modules/hls.js/dist/hls.min.js"></script>

<!-- Library stylesheets -->
<link rel="stylesheet" href="node_modules/typeface-roboto/index.css">
<link rel="stylesheet" href="node_modules/@material-icons/font/css/all.css">
<link rel="stylesheet" href="/node_modules/typeface-roboto/index.css">
<link rel="stylesheet" href="/node_modules/@material-icons/font/css/all.css">
<!-- Custom stylesheets -->
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/watch.css">
<link rel="stylesheet" href="/css/global.css">
<link rel="stylesheet" href="/css/watch.css">
</head>

<body>
<div class="back-btn">
<a href="/index.php">
<a href="/">
<span id="back-btn" class="material-icons md-arrow_back"></span>
</a>
</div>
Expand Down

0 comments on commit 136a85f

Please sign in to comment.