Jump to content

[SOLVED] .htdocs mod_rewrite


micmania1

Recommended Posts

Hi, I want to to use mod_rewrite (I think) on 1 file.

 

I have a url http://www.domain.com/liveimage.php?image_id=123

 

and want it to appear as

 

http://www.domain.com/liveimage/123.gif

 

First of all can anybody helpt me out or point me to a good basic tutorial on how to do this?

 

Secondly, to get my variables (image_id), will I need to parse the url or just use $_GET?

 

 

Link to comment
Share on other sites

You can just you $_GET after you use mod_rewrite.  And put this in the document root .htaccess file:

 

RewriteEngine On

RewriteRule ^liveimage/([0-9]+).gif$ liveimage.php?image_id=$1

RewriteRule ^liveimage/([0-9]+).gif/$ liveimage.php?image_id=$1

Link to comment
Share on other sites

I am currently running on my computer.

 

The domain is therefor curently http://localhost/sitename/

 

It is giving a 500 error message.

 

The .htaccess file is in the sitenarectory and other directories are working fine.

 

I'm using:

Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5

 

My webserver is linux.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.