Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

mod rewrite headache

Featured Replies

I'm adding a download section to my website. I want to track the downloads so I've created a php file that acts as a proxy;

 

it takes one argument: files ($_GET['files']) which is the requested file

it then logs it in the database and servers the file.

 

problem is that when I try to set up mod rewrite to make a nice URL structure for it.

 

What I want is:

If I type http://download.thomthom.net/test.txt the proxy file will get $_GET['file'] = 'test.txt'

If I type http://download.thomthom.net/foo/bar.txt the proxy file will get $_GET['file'] = 'foo/bar.txt'

 

My .htaccess file

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ d.php?file=$1

 

I though this would do it. But it doesn't. Instead the file argument gets populated with 'd.php'. Which I really can not understand why.

try posting this on sitepoint - there a couple of mod rewrite buffs over there.

try posting this on sitepoint - there a couple of mod rewrite buffs over there.

 

guess he beat me to it!

  • Author

I got it working. The problem was that I caused a loop. I had to prevent it redirecting the redirect. It's all good now!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.