iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
IT Discussion Forum Having IT issues? Got IT questions? Who doesn't? If you can't get your Apache to work with your MySQL or your php is choking on your ODBC... Let's see if we can help you come up with some ideas.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-16-2007, 09:03 AM
inertia's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Apr 2006
Location: Lancaster, UK
Posts: 1,021
inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6
Default .htaccess and mod_rewrite

I am trying to get to grips with .htaccess and mod_rewrite but i am lacking experience in this area so please go easy on me.

Im tryin to setup two 301s for a customer. The first solves the "domain.com" redirecting to "www.domain.com" issue. I added an .htaccess file to the ht_docs directory with coding that looked like this:

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

But! This didnt work, when i go to the domain without "www" it is supposed to redirect to the with "www" domain, yes? Can any offer help as to why?

I have also tried to place a 301 redirect from a page - www.customerdomain.com/home.htm to redirect to www.customerdomain.com/. I used the following code in the .htaccess file:

redirect 301 home.htm http://customerdomain.com/

But! This didnt work either! Any help pleeeease!!!!!????
__________________
Latest Blog Post: Google Consultant - Should this Job Title be Allowed? - Matt Inertia's SEO Blog - SEOers.org

"Carpe diem, seize the day boys, make your lives extraordinary"
- Dead Poets Society
Reply With Quote
  #2 (permalink)  
Old 11-16-2007, 09:16 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,681
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: .htaccess and mod_rewrite

Apache Tutorial: .htaccess files

If that is not enough, Google:

".htaccess tutorial"
Reply With Quote
  #3 (permalink)  
Old 11-16-2007, 09:22 AM
inertia's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Apr 2006
Location: Lancaster, UK
Posts: 1,021
inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6
Default Re: .htaccess and mod_rewrite

There is a lot of literature online that ive been reading over the last few weeks. I have taken example coding from these articles and added my own URLs but the redirect still doesnt work. Is there something fundamental which im missing?
__________________
Latest Blog Post: Google Consultant - Should this Job Title be Allowed? - Matt Inertia's SEO Blog - SEOers.org

"Carpe diem, seize the day boys, make your lives extraordinary"
- Dead Poets Society
Reply With Quote
  #4 (permalink)  
Old 11-16-2007, 09:43 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,681
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: .htaccess and mod_rewrite

Sometimes it can be done in the Cpanel or whatever panel you have. If that is not possible, reread the tutorials above.

Have you tried this more specific search:

mod_rewrite site:www dot apache dot org

Here is one hit: ApacheModProxy

Scroll down to the heading:

A more complex example: mod rewrite

Last edited by kgun; 11-16-2007 at 09:49 AM.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > IT Discussion Forum

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to do a mod_rewrite? watto Web Programming Discussion Forum 2 06-02-2007 01:17 PM
mod_rewrite not rewriting wige Web Programming Discussion Forum 4 04-25-2007 08:32 PM
Mod_rewrite for Google - Yes? or No..... Mellco Search Engine Optimization Forum 5 11-29-2005 05:14 PM
mod_rewrite watto Services for Sale/Hire 0 11-08-2005 08:47 PM
mod_rewrite, .htaccess and the root directory problem PhilC Web Programming Discussion Forum 0 02-17-2004 03:30 PM


All times are GMT -4. The time now is 04:55 PM.



Search Engine Optimization by vBSEO 3.3.0