URL Rewrite http to https with www
-
I have a domain with several apps. All apps should be reached like this. https://www.website.com/app1/ https://www.website.com/app2/ https://www.website.com/app3/ The problem I'm having is with my url rewrites. If someone enters website.com/app1/ or www.website.com/app1/ I want it to rewrite to this https://www.website.com/app1/ I've been attempting to use httpd.conf to solve this problem or just .htaccess in the document root folder without any luck. URL rewrite works fine in my codeignighter application, just not in these one off stand alone apps. Can anyone show me the proper way to incorporate url rewrites to solve the above problem?
-
Answer:
Now open httpd.conf or .htaccess file (mod_rewrite not required): # vi httpd.conf Append following line : Redirect permanent /app1 https://www.website.com/app1 Any request made to http://www.website.com/app1 will goto https://www.website.com/app1 Save and close the file. Restart the Apache: # /etc/init.d/httpd restart
Vibration Of Life at Server Fault Visit the source
Related Q & A:
- How to get correct URL in HTTP header?Best solution by Stack Overflow
- How to rewrite URL using htaccess?Best solution by Stack Overflow
- How to rewrite a URL using htaccess?Best solution by Stack Overflow
- How to rewrite the URL in Yii2?Best solution by Stack Overflow
- How to Rewrite URL in htaccess with php?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.