[TYPO3] .htaccess http_host RewriteCond problems with 301

sunshine33777 tronno22556 at gmail.com
Sun Oct 28 23:48:06 CET 2007


I'm having RewriteCond problems.  I'm running Typo3 3.8.1

This is my full .htaccess file:

[CODE]
#####
#
# Example .htaccess file
#
# This file contains a collection of almost everything you will need
# for optimising TYPO3:
#
# - mod_rewrite (used for SimulateStaticDocuments, RealUrl, etc.)
# - PHP optimisation
#
# If you want to use it, you'll need to rename this file to '.htaccess'.
# (To make this work you will need to adjust the 'AllowOverride'
# directive in your Apache configuration file.)
#
# IMPORTANT: You may need to change this file depending on your TYPO3
# installation!
#
# You should change every occurance of TYPO3root/ to the location where you
# have your website in. For example:
# If you have your website located at http://mysite.com/
# then your TYPO3root/ is just empty (remove 'TYPO3root/')
# If you have your website located at http://mysite.com/some/path/
# then your TYPO3root/ is some/path/ (search and replace)
#
# If you have problems with this file, try using the minimal
# mod_rewrite.htaccess which is located in the typo3_src/misc/
# directory of this installation.
#
# You can also use this configuration in your httpd.conf, but you'll have
# to modify some lines, see the comments (search for 'httpd.conf')
#
# Using rewriting in your httpd.conf is much faster, btw.
#
# Questions about this file go to the matching Install mailing list,
# see http://typo3.org/documentation/mailing-lists/
#
####
### Begin: Rewrite stuff ###
# Enable URL rewriting
Options +FollowSymLinks
RewriteEngine On
Redirect 301 /familytree http://sunshinelocksmith.com/deacur/familytree
Redirect 303 /pages/local-service-area.php
http://www.sunshinelocksmith.com/pages/search-for-service-area.php
#Below makes everything www. version
RewriteCond %{HTTP_HOST} (.*)stpetelocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)sunshinelock\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)baypineslocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)treasureislandlocksmith.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)stpetebeachlocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)seminolelocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)saintpetersburglocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)redingtonbeachlocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)pinellasparklocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)pinellaslocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)pinellascountylocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)madeirabeachlocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)locksmithclearwater\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)largolocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)indianshoreslocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)indianrocksbeachlocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)gulfportlocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)clearwaterbeachlocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)belleairlocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)belleairbeachlocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)awesomelocksmith\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)sunshinelocksmithteam\.com [NC,OR]
RewriteCond %{HTTP_HOST} (.*)sunshinelocksmiths\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^sunshinelocksmith\.com [NC]
#RewriteRule ^/?(.*)$ http://www.sunshinelocksmith.com/$1 [L,R=301]
RewriteRule .? http://www.sunshinelocksmith.com%{REQUEST_URI} [L,R=301]
# To assist in debugging rewriting, you could use these lines
# DON'T enable it for production!
# This will only work in httpd.conf, not in .htaccess files
#RewriteLog /var/log/apache/rewrite.log
#RewriteLogLevel 9
# If you use the RealUrl extension, then you'll have to enable the next
line.
# You will have to change this path if your TYPO3 installation is located
# in a subdirectory of the website root.
#
# If you place this in httpd.conf, you cannot use this directive in any
case!
#RewriteBase /
# Stop rewrite processing if we are in the typo3/ directory
# For httpd.conf, use this line instead of the next one:
# RewriteRule
^/TYPO3root/(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/
- [L]
RewriteRule
^(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/ -
[L]
# Redirect http://mysite/typo3 to http://mysite/typo3/index_re.php
# and stop the rewrite processing
# For httpd.conf, use this line instead of the next one:
# RewriteRule ^/TYPO3root/typo3$ /TYPO3root/typo3/index.php [L]
RewriteRule ^typo3$ typo3/index_re.php [L]
# If the file/symlink/directory does not exist => Redirect to index.php
# Important note: If you copy/paste this into httpd.conf instead
# of .htaccess you will need to add '%{DOCUMENT_ROOT}' left to each
# '%{REQUEST_FILENAME}' part.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
# Main URL rewriting.
# If you use Windows and SimulateStaticDocuments do not work, try adding a
# slash (/) right before 'index.php' below.
# The example shows how to rewrite only *.html and *.pdf files to index.php
# This may be helpful when using an extension that can generate PDF files
# on the fly.
# Example: RewriteRule .*\.(html|pdf)$ index.php [L]
# For httpd.conf, use this line instead of the next one that has no '#':
# RewriteRule .* /TYPO3root/index.php [L]
# For use with the RealUrl extension, you might need to remove the
# RewriteBase directive somewhere above and use this line instead of the
# next one:
# RewriteRule .* /index.php [L]
RewriteRule .* index.php [L]
### End: Rewrite stuff ###
### Begin: PHP optimisation ###
# All features below are left to the default if you don't change this.
# Simply remove the comment marks if you want to use some/all of these
# settings
# The PHP developers recommend disabling this feature. Do that.
# It's deprecated and is likely to be unsupported in future versions of PHP.
#php_flag allow_call_time_pass_reference off
# TYPO3 works fine with register_globals turned off.
# This is highly recommended!
#php_flag register_globals off
# PHP may not declare the argv & argc variables (that would contain the GET
# information).
# TYPO3 doesn't need this, so just turn it off.
#php_flag register_argc_argv off
# Magic quotes for runtime-generated data (data from SQL, exec(), etc.)
#php_flag magic_quotes_gpc off
# Order in which PHP registers GET, POST, Cookie and Built-in variables
#php_value variables_order GPCS
### End: PHP optimisation ###
### Begin: Miscellaneous ###
# There is a problem with Internet Explorer and mod_gzip on Apache servers.
# For more information, see
# http://typo3.org/documentation/document-library/rtehtmlarea/Tutorial-79/
#mod_gzip_item_exclude file \.css$
#mod_gzip_item_exclude file \.png$
#mod_gzip_item_exclude file \.gif$
#mod_gzip_item_exclude file \.jpg$
#mod_gzip_item_exclude file \.jpeg$
#mod_gzip_item_exclude file \.js$
### End: Miscellaneous ###
# Add your own rules here
# ...
<Files 403.shtml>
order allow,deny
allow from all
</Files>
deny from 61.152.169.27
deny from 85.18.11.66
deny from 85.158.181.56
deny from 69.10.138.10
deny from 84.97.56.138
deny from 83.177.231.40
deny from 69.2.76.84
deny from 81.169.179.142
deny from 209.200.60.124
deny from 70.24.124.142
deny from 218.83.155.134
deny from 195.76.242.227
deny from 212.76.224.165
deny from 125.7.203.168
deny from 80.227.118.210
deny from 221.232.159.112
deny from 61.28.1.91
deny from 121.88.4.24
deny from 212.239.25.143
deny from 212.116.219.25
[/CODE]

Now, in Typo3  I have about 10 other sites being run at the same time.  For
the site in question here, I have assigned these 2 for the base page:

sunshinelocksmith.com
[url]www.sunshinelocksmith.com/[/url]

I just had [url]www.sunshinelocksmith.com[/url], then tried just
[url]www.sunshinelocksmith.com/[/url] then added the sunshinelocksmith.com
as a 2nd one.  (I can add as many as I need, but want the search engines to
see only one domain and not think I am spamming with duplicate content. 
This is the problem I had with 20 domains pointing to the same site.)

What happens when I type in any of the domains in question (such as
gulfportlocksmith.com) is it throws a 301 which directs to
[url]www.sunshinelocksmith.com/[/url] with a 200.

If I type in [url]www.sunshinelocksmith.com[/url] it gives a 200.

If I type in an internal page such as
[url]www.sunshinelocksmith.com/locksmith-index.php[/url] is it gives a 500. 
None of my internal pages give a 200.

I hope somebody here knows enough about .htaccess to be able to help me. 
It's frustrating because my search program will not spider my own site if it
gets 500.  Plus I can imagine google is thinking my site is crap with all
the 500 codes it's getting back at it.

Anything?

TIA
-- 
View this message in context: http://www.nabble.com/.htaccess-http_host-RewriteCond-problems-with-301-tf4708701.html#a13458930
Sent from the TYPO3 English mailing list archive at Nabble.com.



More information about the TYPO3-english mailing list