Welcome to WebmasterWorld Guest from 107.20.54.98

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

htaccess woes

can't get some htaccess syntax right

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 10, 2000
posts: 2151
votes: 0


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
#
1:25 am on Apr 1, 2010 (gmt 0)

Senior Member

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

joined:July 3, 2002
posts:18903
votes: 0


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.
3:37 pm on Apr 1, 2010 (gmt 0)

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 0


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
6:13 pm on Apr 1, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 10, 2000
posts:2151
votes: 0


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
#
6:17 pm on Apr 1, 2010 (gmt 0)

Senior Member

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

joined:July 3, 2002
posts:18903
votes: 0


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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 10, 2000
posts:2151
votes: 0


didn't work. I'm guessin some conflict somehow. Really wishing I had server access :(
7:38 pm on Apr 5, 2010 (gmt 0)

Senior Member

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

joined:July 3, 2002
posts:18903
votes: 0


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?
2:50 pm on Apr 6, 2010 (gmt 0)

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 0


@g1smd: :)

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

Jim