Oscommerce htaccess on main domain conflicting with wordpres

Oh, the strange things mod_rewrite does!

Oscommerce htaccess on main domain conflicting with wordpres

Postby badmaash » Tue Jul 07, 2009 1:58 pm

First of all, hi! and thanks for having me here...

Usually I have been messing around with one script per domain but now I have got two scripts on the same domain and am having htacess issues

on mydomain.com I have a script and on mydomain.com/blog I have wordpress.

for the main domain the offending htaccess code seems to be:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]

RewriteCond %{THE_REQUEST} ^.*/index.php [NC]
RewriteRule ^(.*)index.php$ http://www.mydomain.com/$1 [R=301,L]



and when you visit the site at mydomain.com.blog you get this error:

Warning: Unexpected character in input: ' in /usr/bin/php5-cgi on line 4009

Warning: Unexpected character in input: '' (ASCII=4) state=1 in /usr/bin/php5-cgi on line 4009

Parse error: syntax error, unexpected '$' in /usr/bin/php5-cgi on line 4009


and the url changes to mydomain.com/cgi-bin/php/blog

Only when I remove the htaccess code on the main domain does wordpress in the subdirectory function correctly.

Anyone know how to get around this problem?

Thanks

B
badmaash
 
Posts: 1
Joined: Tue Jul 07, 2009 1:53 pm

Postby richardk » Wed Jul 08, 2009 8:24 am

for the main domain the offending htaccess code seems to be:

When you remove it the error does not happen?

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{THE_REQUEST} \ /(.+/)?index.php(\?.*)?\  [NC]
RewriteRule ^(.+/)?index\.php$ http://www.example.com/%1 [NC,R=301,L]

RewriteCond %{HTTP_HOST} ^(example\.com)$ [NC]
RewriteRule .* http://www.%1%{REQUEST_URI} [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 8 guests

cron