Jump to content
Server Maintenance This Week. ×

Convert Incoming URL


This topic is 5446 days old. Please don't post here. Open a new topic instead.

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

Link to comment
Share on other sites

  • 4 weeks later...

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

Link to comment
Share on other sites

This topic is 5446 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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