Jump to content
Sign in to follow this  

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?



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.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

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