I've got a fairly massive site that I have to customize the names from the files proven within the URL. I'm using Apache 2 with mod_rewrite enabled. I presently possess the following configuration during my .htaccess file:
RewriteEngine on RewriteBase / RewriteRule ^CakeList\.php$ TastyThingsList.php [T=application/x-httpd-php]
Now, after i access the http://mysitename/CakeList.php I actually do indeed begin to see the data for that TastyThingsList.php page. If your user types in http://mysitename/TastyThingsList.php, they are doing begin to see the page, but instead of the address bar reading through "TastyThingsList.php" I would like it to read "CakeList.php". Is easy to accomplish using mod_rewrite? Observe that the CakeList.php page doesn't really exist, I'm pretty much utilizing it being an alias for that TastyThingsList.php page. I've been reading through most of the online lessons for mod_rewrite, however i cannot appear to obtain the answer.
In a nutshell, if the user types: http://mysitename/CakeList.php or http://mysitename/TastyThingsList.php, I'd like the address within the browser to exhibit http://mysitename/CakeList.php.
Make use of the redirect flag for RewriteRule:
RewriteRule ^TastyThingsList.php$ CakeList.php [R=permanent,L]
This functions by coming back a Hyperlink to the customer browser, which really needs to re-request it, and that is the way it shows within the address bar towards the user.
Ideally, this URL would not be provided if it's never for use, and can be also set up to become inaccessible if entered directly.
Unless of course you've got a really strange httpd configuration, you should not require the T flag within the RewriteRule within the question.