Welcome to WebmasterWorld Guest from 54.196.175.173

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

htaccess woes

can't get some htaccess syntax right

     

oilman

12:00 am on Apr 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



been gone a long time - back to ask for help :)

This htaccess code is causing 500 errors.

It works fine when it's just the CDSEO code. When I add in the bb_Store stuff on and the nonwww stuff it breaks. Any ideas?


DirectoryIndex home.php index.html index.php

# Enable mod rewrite engine
RewriteEngine On

#Matches old bb_store urls and redirects to same url without bb_store
RewriteRule ^bb_store/catalog/(.*)$ http://www.example.com/catalog/$1 [R=301,L]

#Redirects nonwww to www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

# ------------------------------------
# CDSEO Pro
# ------------------------------------
# This directory index is recommended to replace the
# x-cart default within this .htaccess file

# .htpasswd protection
# May be required if your htpasswd files are located below document root
(i.e. cpanel)
# Remove # at the beginning of this line if your unable to access password
protected folders:
ErrorDocument 401 "Unauthorized"

# Some servers require this Options directive to be disabled
# Remove # at the beginning of this line to disable:
#Options -Multiviews

# Some servers require the Rewritebase directive to be enabled
# Remove # at the beginning of this line to enable:
RewriteBase /

RewriteCond %{REQUEST_URI} !^/(payment|admin|provider|partner)/
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ cdseopro.php
# ------------------------------------
# / CDSEO Pro
#

g1smd

1:25 am on Apr 1, 2010 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



You have
RewriteEngine On
twice.

The
RewriteBase /
can be removed as that is the default.

The final RewriteRule (the rewrite) needs an [L] flag, but can't see a lot else to fix.


Do make sure that all of your comment lines do begin with the # mark.
Some appear not to do so, but that might just be the forum wrapping the lines.

jdMorgan

3:37 pm on Apr 1, 2010 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



It appears that you may need to exclude the "catalog" path from your cdseopro rewriterule by adding it to the first RewriteCond in your last rule above.

Jim

oilman

6:13 pm on Apr 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Like so?

DirectoryIndex home.php index.html index.php

# Enable mod rewrite engine
RewriteEngine On

#Matches old bb_store urls and redirects to same url without bb_store
RewriteRule ^bb_store/catalog/(.*)$ http://www.example.com/catalog/$1 [R=301,L]

#Redirects nonwww to www
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

# ------------------------------------
# CDSEO Pro
# ------------------------------------
# This directory index is recommended to replace the
# x-cart default within this .htaccess file

# .htpasswd protection
# May be required if your htpasswd files are located below document root
(i.e. cpanel)
# Remove # at the beginning of this line if your unable to access password
protected folders:
ErrorDocument 401 "Unauthorized"

# Some servers require this Options directive to be disabled
# Remove # at the beginning of this line to disable:
#Options -Multiviews

# Some servers require the Rewritebase directive to be enabled
# Remove # at the beginning of this line to enable:

RewriteCond %{REQUEST_URI} !^/(payment|admin|provider|partner|catalog)/
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ cdseopro.php [L]
# ------------------------------------
# / CDSEO Pro
#

g1smd

6:17 pm on Apr 1, 2010 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Looks good.

oilman

7:14 pm on Apr 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



didn't work. I'm guessin some conflict somehow. Really wishing I had server access :(

g1smd

7:38 pm on Apr 5, 2010 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Don't let jdMorgan see that too-vague-to-be-useful "didn't work" report. :)

What was the test URL (use example.com to mask the real domain name)?
What was supposed to happen?
What actually happened?
How did that differ from what was expected?
What did you see when using Live HTTP Headers to examine the HTTP transaction?
What do the server error logs say?

jdMorgan

2:50 pm on Apr 6, 2010 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



@g1smd: :)

@oil: Be sure to delete your browser cache before testing any new code.

Jim
 

Featured Threads

Hot Threads This Week

Hot Threads This Month