| | |
.htaccess troubles
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved
![]() |
•
•
Join Date: Feb 2008
Posts: 28
Reputation:
Solved Threads: 0
I have a .htaccess file which forwards non www request to www
However, I have a problem if i were to put into the url mysite.com/test.php it will not forward to the www site. Any help on how i can get this fixed would be greatly appreciated. It does work if I just put mysite.com it will forward it to http://www.mysite.com. It just doesn't work when i add mysite.com/test.php
Thanks.
PHP Syntax (Toggle Plain Text)
Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^mysite.com [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
However, I have a problem if i were to put into the url mysite.com/test.php it will not forward to the www site. Any help on how i can get this fixed would be greatly appreciated. It does work if I just put mysite.com it will forward it to http://www.mysite.com. It just doesn't work when i add mysite.com/test.php
Thanks.
•
•
Join Date: Sep 2008
Posts: 330
Reputation:
Solved Threads: 27
Is it a linux server with apache mod-rewrite module installed? Why not use a simple html redirect
•
•
•
•
<meta http-equiv="refresh" content="2;url=http://www.yoursite.com">
Last edited by freshfitz; Mar 9th, 2009 at 1:34 am.
i have tried this..
its worked fine for me...
its worked fine for me...
PHP Syntax (Toggle Plain Text)
Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^mysite\.com [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
•
•
Join Date: Feb 2008
Posts: 28
Reputation:
Solved Threads: 0
•
•
•
•
i have tried this..
its worked fine for me...
PHP Syntax (Toggle Plain Text)
Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^mysite\.com [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
![]() |
Other Threads in the PHP Forum
- Previous Thread: quiz software
- Next Thread: GetMetaTags Problem
| Thread Tools | Search this Thread |
.htaccess access alexa apache api array autocomplete beginner broken cakephp class cms code convert cron curl database date directory display dropdown duplicates dynamic email emptydisplayvalue encode error execute explodefunction fairness file folder form forms function functions google hack href htaccess html htmlspecialchars image include indentedsubcategory ip javasciptvalidation javascript joomla keywords limit link login mail matching menu methods multiple multipletables mysql network newsletters object oop passwords paypal pdf php provider query radio random recursive redirect remote script search secure securephp server sessions shot simple source space sql subscription system table tutorial tutorials upload url user validator variable video voteup web youtube






