hi, i have this domain for example: mydomain.com and i want when i enter this url in browser: mydomain.com/test the htacess see the "test" redirect the site for test location ex: www.silva.com and to that for the other words that i enter after "/" for the folders that exist in server the htacess will don´t do nothing the objective is only for the words what i want this is possible? thanks for your help
What exactly are you trying to do? You left that part out There might be a better way to accomplish your task.
what is test.. a file, folder or what? explain it first if you want help on it. and who's site is silva dot com?
put in .htaccess the following: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /controller.php [L] </IfModule> Code (markup): then in controller.php put the following if($_SERVER["REDIRECT_URL"]=='/test/'){ //do this } Code (markup):
This is similar to how wordpress handle's friendly URLs in .htaccess RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Code (markup): See the two RewriteCond lines ending in !-f and !-d Those conditions mean as long as the filename is not an existing directory or existing file. If they are, then it skips the rule and goes straight to that file or folder.