Jump to content

Redirecting virtual/non-existing folder accesses to a script


redsmurph

Recommended Posts

For my service I need to redirect "site/name" to "site/index.php?namearg=name"

 

I've tried ErrorDocument 404 in .htaccess, but when the error script is called SERVER_URI is replaced with the name of the error script rather than retains the original URL/path, so there's no way of telling what "name" is.

 

As many services do the above somehow, there must be a simple solution.

 

I've also tried using the following

#Options +FollowSymlinks

#RewriteEngine on

#RewriteRule ^(.+) index.php?blog=$1 [nc]

but then also index.php is replaced (recursively?). How can I tell it to exclude certain scripts and pages?

 

Any advice would be very much appreciated, as the service simply won't be user-friendly without it.

 

Many thanks in advance

Archived

This topic is now archived and is closed to further replies.

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