Jump to content
Sign in to follow this  
Chuck

Convert Incoming URL

Recommended Posts

Using Mac OS X Leopard Server's Apache, does anyone know if it's possible to take a URL like http://domain.com/1234 and reinterpret it so that it's executed as http://domain.com/index.php?param=1234, and if so, how I would go about it?

Thanks,

Chuck

Share this post


Link to post
Share on other sites

Hi Chuck,

yes, this is possible. You can solve it with an .htaccess-file in the doc-root of your server.

In the .htaccess you can do some rewriting-stuff like

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !.php

RewriteRule ^/?([^/]*.html?|[^./]*)[:P;,.]*$ index.php?goto=$1 [L,NS]

In this case the parameter after domainname.com/blabla will be passed as index.php?goto=blabla

!!! You have to enable "Allow all overrides" (I don't know how this is exactly called in an US-MAC OS) within Server-Admin / Web / Domain / Options. Otherwise .htaccess will be ignored.

/horst

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.