Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Alternative Computing > Linux Support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Linux Support Linux - Operating Systems and Applications Support

Reply
 
LinkBack Thread Tools
Old 01-04-2009, 06:46 PM   #1 (permalink)
Registered User
 
Join Date: Jan 2009
Posts: 1
OS: Vista


.htaccess and 301 redirects

My current .htaccess file looks like #1 and I am trying to set up 301 redirects properly and need to add I think the code in #2 I want to redirect non www. domain to main site and also my .index along with 2 other domains, call them 1domain and 2domain, my thai host has no clue -he not smart
Can anyone help me combine the existing with the correct 301 redirects so I dont mess up?

#1 existing htaccess file on my site

php_flag register_globals off

Options -Indexes

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteRule tags/([^\.\/]+)/?$
tags/index.php?request_uri=%{REQUEST_URI}&mod_rewrite=1

RewriteRule press/cat_([0-9a-z]+)/?page_([0-9]+)\.html$
press/index.php?category_id=$1&page=$2&mod_rewrite=1
RewriteRule press/cat_([0-9a-z]+)/?$
press/index.php?category_id=$1&mod_rewrite=1
ReWriteRule press/page_([0-9]+)\.html$ press/index.php?page=$1&mod_rewrite=1

RewriteRule press/post_([0-9]+)-?([0-9]*)\.html$
press/index.php?post_id=$1&page=$2&mod_rewrite=1

ReWriteRule member/profile_(.+)(_page([0-9]+)*)\.html$
member/profile.php?ID=$1&step=$3
ReWriteRule member/profile_(.+)\.html$ member/profile.php?ID=$1

ReWriteRule video_(.+)\.xml xml_videolist.php?type=$1

</IfModule>

------------------------------
#2 I think is correct for redirects but need comined with top existing htaccess file and both require headers so need to do without messing up.

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.(html?|php|asp|cfm)\
HTTP/
RewriteRule ^(.*)index\.(html?|php|asp|cfm)$ http://www.mydomain.com/$1
[R=301,L]

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

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

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

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

RewriteCond %{HTTP_HOST} ^www.2domain.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]
__________________
Thank you to help me
Asian Girl is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 01-05-2009, 04:56 AM   #2 (permalink)
Moderator/Fedora Amb.
 
wmorri's Avatar
 
Join Date: May 2008
Location: /pm/etc
Posts: 2,821
OS: Window 7/Fedora 10

My System

Send a message via AIM to wmorri
Re: .htaccess and 301 redirects

Hi,

I have to admit that htaccess isn't something that I have had to deal with a lot, so I don't really know a lot about it. I would recommend that you take a look at this for starters and see if it can help you much. You might be dealing with things that are above the tutorial I am not to sure.

Cheers!
__________________


Linux Forever!

wmorri is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 10:46 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85