lopez86100 Posted February 23, 2007 Share Posted February 23, 2007 I am quite a newbie with mod rewrite. I've created .htaccess file in my root directory. I've anabled mod_rewrite and wildcard. Now I'm trying to write one rule but it is to difficult for me. I'm trying for 5 days and nothing . The rule has to "replace" url for example : http://www.my.very.long.subdomain.domain.com/file_name.php into http://www.domain.com/my.very.long.subdomain/file_name.php I don't want to redirect it but just to show file_name.php which is located in real directory (the directory name in this case is my.very.long.subdomain), , it's wildcard so it doesn't work as normal subdomain. The rule can't rewrite url if there is index.php after slash (e.g. http://www.my.very.long.subdomain.domain.com/index.php), in this case it can not be rewritten. So, I've made something like this but it doesn't work for me. ------------------ .htaccess file ------------------ RewriteEngine On RewriteCond %{REQUEST_FILENAME} !^/?index\.php$ RewriteCond %{HTTP_HOST} ^www\..*\.domain\.com/.*\.php/? RewriteRule ^w?w?w?\.?(.*)\.domain\.com/(.*)\.php$ domain.com/$1/$2.php Please somebody help me Link to comment https://forums.phpfreaks.com/topic/39822-phpapache-mod_rewrite/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.