Hello everyone, I want to rediret this url to http://www.mysite.com/secured to https://www.mysite.com/secured using .htaccess file Kindly help me regarding this. I am a total newbie so it would be a big help.
Maybe try something like this: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^secured(.*) https://www.yoursite.com/secured$1 [R,L] Code (markup):
While trying to create through cpanel I am getting the following error please help me. Apache detected an error in the Rewrite config. Syntax error on line 4 of /home/username/public_html/.htaccess.GWRdjATPmJtzaqQlUxvdOB3ZnsKKD4Pm: RewriteCond> directive missing closing '>' Please try again. Anyway thanks a lot.
hmm are you sure you have pasted that code correctly? Because it works perfectly fine when I test it on my site. Try manually to enter those lines in your .htaccess file instead of through cpanel. Open your .htaccess from your main html folder with any text editor (for example notepad) and paste those lines. If you already have "RewriteEngine On" in your .htaccess then skip that part and just paste those two lines I suggested.
Something is not right here... Do you use your ftp client to edit text files on the spot. It might help. CuteFTP is great for it but I know most will allow you to edit/view files without moving them from the server. This should stop any problems with text encoding that notepad can cause. I dont understand why you have a hash after your .htaccess file in the error message. Have you named the file correctly? Sorry if I'm teaching you to suck eggs!
RewriteEngine on RewriteCond %{HTTP_HOST} ^mysite.com$ [OR] RewriteCond %{HTTP_HOST} ^www.mysite.com$ RewriteRule ^secured/?$ "https\:\/\/www\.mysite\.com\/secured" [R=301,L]
hey eveyone seems to know something here, how can we rewrite from "root/forums/anyurls" to "root/anyurls" no-one knows this!
Make the index a PHP file and use this code instead: <?php header("Location: https://www.mysite.com/secured"); ?>