![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| 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: * 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 |
|
|||||||
| Linux Support Linux - Operating Systems and Applications Support |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#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 |
|
|
|
| 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 |
|
|
#2 (permalink) |
|
Moderator/Fedora Amb.
|
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!
|
|
|
|
![]() |
| Thread Tools | |
|
|