LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   [mod_rewrite] nothing happens ahen ruls are included (https://www.linuxquestions.org/questions/linux-newbie-8/%5Bmod_rewrite%5D-nothing-happens-ahen-ruls-are-included-880316/)

pawelch 05-12-2011 09:02 AM

[mod_rewrite] nothing happens ahen ruls are included
 
Hi guys,
I have just installed apache with mod rewrite to give it try. I am using Ubuntu and my website is visible with http://localhost/ URL. I was trying to add:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

to apache2.conf but it did not work and did not give any results. the log file did not contain any errors.
What should I do?

thank you

vivaystn 05-12-2011 11:17 AM

In your apache config file add this AccessFileName .htaccess then cut the mentioned 3 lines and put them in the file .htaccess (you should create it if not exist) under apache2 folder. You need .htaccess because is checked on every click on your site and the config is checked only on server start.

Did that help?


All times are GMT -5. The time now is 10:16 PM.