Hello everyone
Can someone direct my how to perform a 301 redirect for me directory please. You know from http://domain.com to http://www.domain.com
thanks
Hello everyone
Can someone direct my how to perform a 301 redirect for me directory please. You know from http://domain.com to http://www.domain.com
thanks
I use the following, replace my domain with yours and enter it AFTER the line that says # INDEX END
RewriteCond %{HTTP_HOST} ^moparmuscle.net$
RewriteRule ^(.*)$ http://www.moparmuscle.net/$1 [R=301,L]
ErrorDocument 404 http://www.moparmuscle.net/
Enter this where pls? Do you mean the .htaccess file?
Last edited by spin; 07-22-2007 at 07:20 PM.
In .htaccess yes
thanks for reply......I did as instructed....their was no redirect and I got 404 when i clicked a category...
Either you did it wrong, or your host doesn't allow 301 redirects. Paste your .htaccess here and I'll confirm it.
Code:# INDEXU-START # DO NOT CHANGE THE FOLLOWING LINES # status: 1 # pattern_category: {$cat_path}/more{$page}.html # pattern_detail: detail/{$link_id}/{$link_title}.html # pattern_tag: tag/{$tag}/more{$page}.html Options -MultiViews RewriteEngine On RewriteRule ^detail/(.*)/(.*).html detail.php?linkid=$1 RewriteRule ^tag/(.*)/more(.*).html browsetag.php?tag=$1&pg_which=$2 RewriteRule ^tag/(.*) browsetag.php?tag=$1 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^.* browse.php # INDEXU-END RewriteCond %{HTTP_HOST} ^pirahnaseek.com$ RewriteRule ^(.*)$ http://www.pirahnaseek.com/$1 [R=301,L] ErrorDocument 404 http://www.pirahnaseek.com/
OK now it will rediret like this but becomes non seo friendly...I want a seo friendly directory
any suggestions?
Last edited by spin; 07-23-2007 at 01:50 AM.
About the only thing you can add/change is the following. Otherwise it is all correct and will be redirecting and still seo friendly.
# INDEXU-END
rewriteBase /
RewriteCond %{HTTP_HOST} ^pirahnaseek.com$
RewriteRule ^(.*)$ http://www.pirahnaseek.com/$1 [R=301,L]
The last line (404) isn't necessary. You can try taking that one out. I included it but shouldn't have.
If it's not functioning then talk to your host and ensure that you have permissions to run everything in the htaccess. Also some servers run things differently, your host may have suggestions.