0

Okay, so I have a script that works like adf.ly; you submit a URL, the Url is shortened and then an interstitial advertisement shown before you're taken to your URL. I have the following .htaccess located in the root:

DirectoryIndex index.php

FileETag none
ServerSignature Off

Options All -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^([0-9a-zA-Z]{1,6})$ fly/?to=$1 [L]
RewriteRule ^([0-9]{1,9})/banner/(.*)$ fly/?uid=$1&adt=2&url=$2 [L]
RewriteRule ^([0-9]{1,9})/(.*)$ fly/?uid=$1&adt=1&url=$2 [L]
</IfModule>

The script is generating the shortURL's (you can try here: http://www.twitsym.com/short/) however it is not redirecting to fly.php and then the final URL. I'm terrible with .htaccess and have little to no knowledge. Can anybody edge me further as to what might be causing the problem?

Directory structure is:

.../
.../fly/index.php

Thank you again, StackOverflow!

  • what happens? can you put rewrite log here? – undone Apr 04 '12 at 13:11
  • I'll be honest, I've tried to locate the rewrite log using numerous guides over the past hour but can't seem to pick it out. I'm fairly new to an unmanaged linux server and any direction would be helpful. Seems I can't simply comment at the bottom of the .htaccess file anymore to generate a log. – Dominic Kirkwood Apr 04 '12 at 14:13

1 Answers1

0

it seems that you will need the LogLevel directive somewhere in your httpd.conf or vhost.conf if this is a virtual server. See this post for a similar question. The code would be:

RewriteLogLevel 3
RewriteLog "/usr/local/var/apache/logs/rewrite.log"

Where is the htaccess supposed to be redirecting to (i.e. which URL should lead whereto?) Additionally, you asked for being redirected to fly.php, however it does not occur in your .htaccess. Was this your intention?

Community
  • 1
  • 1
Jan
  • 42,290
  • 8
  • 54
  • 79
  • [Wed Apr 04 16:10:23 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec) [Wed Apr 04 16:10:23 2012] [error] (2)No such file or directory: mod_rewrite: could not open RewriteLog file /usr/local/var/apache/logs/rewrite.log Configuration Failed --- I remember reading somewhere about suexec (running a dedicated linux box), perhaps that's throwing the error. Regarding the fly.php, it's pointing to the /fly/ directory that contains index.php. I assume the script is pointing to fly/index.php?to=$1. Thanks for your reply Jan. – Dominic Kirkwood Apr 04 '12 at 21:16
  • I'm desperate, If anybody would care to help via IM (I'm sure the problem is simple) I can be reached on AIM at 'DoMxDevelopment'; The answer can be posted and finalised here. Thanks for taking a look guys, further input still welcome. – Dominic Kirkwood Apr 05 '12 at 00:49