| | |
.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: 339
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 ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web websphere white xml youtube






