Link to home
Start Free TrialLog in
Avatar of roman07
roman07Flag for China

asked on

.htacces causing URL error with xcart...

Hi there...

I am using the following .htaccess with an apache hosted site on windows running PHP5:

#######START OF .htaccess#######
#DirectoryIndex index.php index.html home.html home.php
#DirectoryIndex index.php

RedirectMatch 404 ^.*/\.pgp.*/.*$
RedirectMatch 404 ^.*/sql/.*$
RedirectMatch 404 ^.*/schemes/.*$
RedirectMatch 404 ^.*/skin1_original/.*$
RedirectMatch 404 ^.*/Smarty.*$
RedirectMatch 404 ^.*/upgrade/.*$
RedirectMatch 404 ^.*/shipping/.*$
RedirectMatch 404 ^.*/var/.*$

RedirectMatch 404 ^.*\.(ini|tpl|sql|log|conf|bak|tpl)$

RedirectMatch 404 ^.*/COPYRIGHT.*$
RedirectMatch 404 ^.*/INSTALL.*$
RedirectMatch 404 ^.*/NEW.*$
RedirectMatch 404 ^.*/README.*$
RedirectMatch 404 ^.*/UPGRADE.*$
RedirectMatch 404 ^.*/VERSION.*$
RedirectMatch 404 ^.*/include/version\.php$
RedirectMatch 404 ^.*/config\.php$
RedirectMatch 404 ^.*/top\.inc\.php$
RedirectMatch 404 ^.*/install\.php$

ErrorDocument 401 "<h1>401 - Forbidden: Access is denied.</h1><br /><p><strong>You do not have permission to view this directory or page using the credentials that you supplied.</strong></p>
ErrorDocument 403 "<h1>403 - Forbidden: Access is denied.</h1><br /><p><strong>You do not have permission to view this directory or page using the credentials that you supplied.</strong></p>
ErrorDocument 404 "<h1>404 - Page not found!</h1><br /><p><strong>The page you requested could not be found!</strong></p>

Options +FollowSymLinks -Indexes -Multiviews

RewriteEngine On

RewriteBase /

RewriteCond %{QUERY_STRING} !phpss_xcseo_url=
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} \.(htm|html|php|php3|php4|php5)$
RewriteRule ^(.+)$ phpss_xcseo.php?phpss_xcseo_url=$1&phpss_uri_exists=true [QSA,L]

RewriteCond %{QUERY_STRING} !phpss_xcseo_url=
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ phpss_xcseo.php?phpss_xcseo_url=$1 [QSA,L]
#######END OF .htaccess#######

This is performing exactly how I want it to perform and rewriting my URL for my hosted xcart store....but if a user trys to register for an account on my store....

E.g.
http://www.myurl.com/register.php
They fill out the form and hit Submit...when the form posts to itself...the url it posts to is:
http://www.myurl.com/\register.php
Thus the system cannot find this... If I get rid of the .htaccess file the register works fine...except my other urls screw up. I need this .htaccess file...but what do i need to change so it does not insert "\" into the url on that link above....

Many thanks,...
Avatar of Bernard Savonet
Bernard Savonet
Flag of France image

1 - Just to make a tickmark on the check list: can you paste here all the php / javascript / html lines where register.php is used by your form?

ASKER CERTIFIED SOLUTION
Avatar of roman07
roman07
Flag of China image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of roman07

ASKER

# Remove multiple slashes after a domain

RewriteRule ^/(.*)$ http://www.domain.com/$1 [R=301,L]

Or in the case above...comment out the old rewriterules and use the following:

RewriteRule ^/(.*)$ phpss_xcseo.php?phpss_xcseo_url=$1&phpss_uri_exists=true [R=301,L]