Solved

redirect www.xyz.com to xyz.com and the other way around

Posted on 2011-02-14
3
315 Views
Last Modified: 2012-05-11
Hi,

is there a way to redirect any url of the form www.xyz.com/any_folder/anyfile.php?parameter=any_parameter

to
xyz.com/any_folder/anyfile.php?parameter=any_parameter

?
And is the xyz.com/..... option compatible with all browsers?

Regards,
G
0
Comment
Question by:expertsgerrit
  • 2
3 Comments
 
LVL 4

Expert Comment

by:l4ncel0t
ID: 34886959
no problem

        RewriteEngine On
        RewriteCond %{HTTP_HOST} www\.xyz\.com
        RewriteRule ^/(.*)$ https://xyz.com/$1 [L,R=301]


This should work
0
 

Author Comment

by:expertsgerrit
ID: 34891207
where should I put this?
any file that gets visited
some header file?
0
 
LVL 4

Accepted Solution

by:
l4ncel0t earned 500 total points
ID: 34896068
In your apache config
If you have virtualhost in the virtualhost definition
if not in the main apache config file
eg
/etc/apache2/site-avaiable/apache2.conf
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now