Friday, May 18, 2012

apache rewrite rules issue for specific pages


I have problem with my .htaccess redirections. When I type:




http://www.domain.com/contact



it goes to the index.php and not the contact.php



here's my .htaccess:




Redirect 301 /clients http://clients.domain.com

RewriteEngine On
SetEnvIf Host ^www\. page=www
SetEnvIf Host ^mob\. page=mobile

RewriteBase /
SetEnvIfNoCase User-Agent "^Wget" bad_bo
#etc ...
Deny from env=bad_bot

RewriteCond %{HTTP_HOST} !^www.domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301]

RewriteRule ^about/?$ about.php
RewriteRule ^contact/?$ contact.php

rewriterule ^(.*)$ index.php?subdomain=%{ENV:page}&page=$1



in my php i get:




<?php

print_r($_GET);
Array (
[subdomain] => www
[page] => contact.php
)



What am I missing?


Source: Tips4all

No comments:

Post a Comment