Jump to content

.htaccess and 301 redirects


Asian Girl

Recommended Posts

My current .htaccess file looks like sample #1 and I am trying to set up 301 redirects properly and need to add I think the code in sample #2  I want to redirect non www. domain to main site and also my .index along with 2 other domains, 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?

 

SAMPLE #1 existing htaccess

 

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>

 

------------------------------

SAMPLE #2 I think is correct for redirects but need comined with top

 

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.thainigirls.com/$1

[R=301,L]

 

RewriteCond %{HTTP_HOST} ^thainigirls.com [NC]

RewriteRule ^(.*)$ http://www.thainigirls.com/$1 [L,R=301]

 

RewriteCond %{HTTP_HOST} ^freedatingmarriage.com [NC]

RewriteRule ^(.*)$ http://www.thainigirls.com/$1 [L,R=301]

 

RewriteCond %{HTTP_HOST} ^www.freedatingmarriage.com [NC]

RewriteRule ^(.*)$ http://www.thainigirls.com/$1 [L,R=301]

 

RewriteCond %{HTTP_HOST} ^asianthaigirls.com [NC]

RewriteRule ^(.*)$ http://www.thainigirls.com/$1 [L,R=301]

 

RewriteCond %{HTTP_HOST} ^www.asianthaigirls.com [NC]

RewriteRule ^(.*)$ http://www.thainigirls.com/$1 [L,R=301]

 

Link to comment
https://forums.phpfreaks.com/topic/139179-htaccess-and-301-redirects/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.