Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 08-08-2014, 04:25 AM   #1
Registered: Dec 2011
Posts: 233

Rep: Reputation: Disabled
Question on RewriteRule

I need to create a RewriteRule (with Apache) in order to: ->

how can I do this?

Thank you

Last edited by circus78; 08-08-2014 at 04:35 AM. Reason: better
Old 08-08-2014, 05:17 AM   #2
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Add following code in your .htaccess file.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
RewriteRule probem web_questions Linux - Networking 2 10-04-2012 01:49 PM
Apache RewriteRule help danster3k Linux - Server 3 10-06-2010 01:35 AM
Question about RewriteRule? your_shadow03 Linux - Newbie 12 12-27-2009 01:17 AM
Apache RewriteRule does not do what I want? Ujjain Linux - Server 0 03-26-2009 07:46 AM
Apache rewriterule mesh2005 Linux - Server 1 08-03-2007 02:23 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration