0

so I just implemented the YOURLS script successfully, or so I thought.

It generates the shortened URL succesfully and adds it too the YOURLS url ID table, but when I try and navigate to the website, via using the new shortened url. I always get the same error message in the browser.

Not Found

The requested URL /4 was not found on this server.

Apache/2.4.3 (Unix) Server at scof.me Port 80

Most appreciated if you could help!

zessx
  • 68,042
  • 28
  • 135
  • 158
AlexDuncan
  • 95
  • 1
  • 3
  • 12
  • Provide the name of the script getting called, your .htaccess file (in case you use mod_rewrite) and the overall folder structure of your server. – SteAp Feb 20 '13 at 23:13
  • Is .htaccess is provided in the latest release of Yourls? I can't find it? – AlexDuncan Feb 20 '13 at 23:28
  • Don't know. I just asked to provide more details. You question is far too short – SteAp Feb 20 '13 at 23:34
  • Looking at the code, Yourls seems to be supposed to create a .htaccess file at install time – Pekka Feb 20 '13 at 23:39
  • can't find it anywhere in the file manager. Is there source code/script for the .htaccess file available for download? – AlexDuncan Feb 20 '13 at 23:50

2 Answers2

2

YOURLS has information on creating the .htaccess file manually on this page.

For a root install, the file has to look like this:

Case: YOURLS installed on root

If YOURLS root URL is http://www.example.com/, the .htaccess file in the root directory must be like:

# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /yourls-loader.php [L]
</IfModule>
# END YOURLS
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
0

I had the same problem on amazon aws ubuntu 12 and solved here:

https://askubuntu.com/questions/48362/how-to-enable-mod-rewrite-in-apache

"If you plan on using mod_rewrite in .htaccess files, you also need to enable the use of .htaccess files by changing AllowOverride None to AllowOverride FileInfo. For the default website, edit /etc/apache2/sites-available/default:"

And yes I plan on using mod_rewrite in .htacess then..

Then you have to restart apache.

Community
  • 1
  • 1
bendecko
  • 2,643
  • 1
  • 23
  • 33