URL Shortener Debug Test


1. File Structure Check

Current directory: /home/planner/public_html/txtlink
config.php exists: NO
redirect.php exists: YES
.htaccess exists: YES

2. Apache Modules Check

Cannot check Apache modules (not available in this environment)

3. Database Connection Test

Database connection: SUCCESS
Table 'short_urls' exists: YES
Table 'click_analytics' exists: YES
Table 'domains' exists: YES

4. Short Code Test

Testing short code: 8OZIcd
Short code found: NO
This means the short code doesn't exist in the database.

5. Server Environment

PHP Version: 8.1.33
Server Software: Apache
Document Root: /home/planner/public_html/txtlink
Current Domain: txtlink.us
Request URI: /debug_test.php

6. URL Rewrite Test

Test these URLs manually:
1. Direct redirect test
2. Short URL test

7. .htaccess Content

RewriteEngine On

# Don't redirect if file or directory exists
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Don't redirect admin, api, or other system paths
RewriteCond %{REQUEST_URI} !^/(admin|api|assets|css|js|images|uploads)/

# Redirect short codes to redirect.php
RewriteRule ^([a-zA-Z0-9]+)/?$ redirect.php?code=$1 [L,QSA]

# Optional: Redirect to HTTPS (uncomment if needed)
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Optional: Remove trailing slashes (uncomment if needed)
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)/$ /$1 [L,R=301]

8. Recent URLs in Database

Short CodeDomainOriginal URLClicksCreated
RxcTUwjetlynq.comhttps://secure.anedot.com/jeff-wood-for-star-city-...02025-09-20 00:29:15
zJBpavtxtlink.ushttps://secure.anedot.com/jeff-wood-for-star-city-...32025-09-20 00:27:38
e2QVayjetlynq.comhttps://www.fiverr.com/s/8z2Z6gE...22025-08-24 00:20:05
YpumfFtxtlink.ushttps://www.fiverr.com/s/NN3Zk5p...22025-08-21 21:59:20
BMqt7Ojetlynq.comhttps://www.fiverr.com/s/8z2Z6gE...22025-08-21 21:58:33

Next Steps:

  1. If database connection failed, fix config.php
  2. If short code not found, create a new short URL
  3. If mod_rewrite not enabled, contact your hosting provider
  4. If .htaccess missing, upload the correct .htaccess file
  5. If redirect.php missing, upload the correct redirect.php file

Delete this file after debugging for security reasons.