Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 2nd, 2009, 04:23 AM
AndyPSV AndyPSV is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 3 AndyPSV User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 24 sec
Reputation Power: 0
mod_rewrite - .htaccess redirect on page without www

I've got domain.
I want now when user types -> Ww.domain|com
redirect on: hTp://domain|com/

The problem is, that I've got .htaccess already:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php


RewriteCond %{HTTP_HOST} ^wW.rcdrugs|com$ [NC]
RewriteRule ^(.*)$ hTtp://rcdrugs|com/$1 [R=301,L]


When I enter:: hTp://wW.domain|com/help it redirects me to: hTtp://domain|com/index.php
My full rewrite rule is above.

I want to get: hTp://wW..../help -> hTp://.../help.

P.S. "We are sorry, new user accounts are not permitted to create posts containing URLs. Please review our forum rules for more information."

Reply With Quote
  #2  
Old June 2nd, 2009, 07:16 AM
Sarah_S Sarah_S is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 197 Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Days 54 m 11 sec
Reputation Power: 275
Hello,

Instead of:
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php

How about trying this?
Code:
RewriteRule ^$ /index.php [R=301]

Full example:
Code:
RewriteEngine On
RewriteBase /

RewriteRule ^$ /index.php [R=301]

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

I hope it helps.

Reply With Quote
  #3  
Old June 2nd, 2009, 07:42 AM
AndyPSV AndyPSV is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 3 AndyPSV User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 24 sec
Reputation Power: 0
With this configuration site isn't working...


Edit. Know on old configuration website started to work as I expect . Weird
Thanks for help. Anyway

Reply With Quote
  #4  
Old June 2nd, 2009, 08:53 AM
Sarah_S Sarah_S is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 197 Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Days 54 m 11 sec
Reputation Power: 275
Can you please elaborate "isn't working"?

My example code works fine for me so I do not really know why it does not work for you.

Edit: I see you edited your post after I started writing this. I'm glad you sorted it out on your own.

Reply With Quote
  #5  
Old June 2nd, 2009, 08:56 AM
AndyPSV AndyPSV is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 3 AndyPSV User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 24 sec
Reputation Power: 0
Maybe it works, but my website engine code is complicated a bit and it throws errors (can't load module). But everything is ok now! THANKS for HELP!

Reply With Quote
  #6  
Old June 2nd, 2009, 08:59 AM
Sarah_S Sarah_S is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 197 Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level)Sarah_S User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Days 54 m 11 sec
Reputation Power: 275
I see. That is great

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > mod_rewrite - .htaccess redirect on page without www


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT