SMF Support > Server Performance and Configuration

my non www url is not redirecting to www, help neede please.

(1/2) > >>

drfun:
good day to you all in the house, please i need help on fixing this issue. i noticed that my site url does not redirect to www.mysite.com when i type in the adress bar http://mysite.com ,i have searched and got some tips that worked for others having thesame problem and tried doing so from the user interface on cpanel to redirect the non www to www url but it gives me lots of error on the error log. ok i decieded to try the second option i saw on this grate forum, which is the codes for 103 redirect to be placed in the .htaccess in the root server but i have not seen this .htaccess file in my root server. i have checked and checked each folder one after the other and i have not seen this.
i will be grateful if i get any help in fixing this. thanks

Kermit:
As far as i know,you can achieve this by placing a .htaccess file in the main directory of your site (where the index.php file of forum is located) and paste these codes in that file


--- Code: ---RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite\.com$
RewriteRule ^.*$ http://www.mysite.com%{REQUEST_URI} [R=permanent,L]
--- End code ---

drfun:
@Kermit thanks alot for the responds, but how do i create this .htaccess file and in what format, is it in .txt, or php. i noticed that there is no .htaccess file in my root directory where the index.php file of my forum is located.

Kermit:
Take attached file and replace mysite parts with yours

drfun:
Just uploaded the .htaccess now and both the non www and www url of my site is not loading, it is giving me this error
--- Quote ---Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@allstudentforum.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.


--- End quote ---
i check the error log and got lots of error. also i cant even see the .htaccess file in the root directory to delete it. i check on the redirect icon in the cpanel and tried to remove the .htaccess and it not removing rather giving me this error
--- Quote ---Apache detected an error in the Rewrite config. Syntax error on line 1 of /home/xxxxxx/public_html/.htaccess.O1DkW2ZftOfHsoSltoN4Dz_w8h56dJQH: Invalid command '\xef\xbb\xbfRewriteEngine', perhaps misspelled or defined by a module not included in the server configuration Please try again.
--- End quote ---
this is my site url www.allstudentforum.com

Navigation

[0] Message Index

[#] Next page

Go to full version