Jump to content

Archived

This topic is now archived and is closed to further replies.

Java Roasters

Remove index.php when browsing back to main page

Recommended Posts

Hello peeps,

 

Need a "little" help.

My oscommerce is playing a trick. When I load it initially everything goes fine.

As soon as I reload the "Home" the contents of the 'Categories' and the 'Manufacturers' change from the contents of my DB to 'www.dishop.com'.

I tried almost everything, including some tips from this topic. But am missing something.

Does anyone has a good lead?

 

Cheers

Share this post


Link to post
Share on other sites
Hello peeps,

 

Need a "little" help.

My oscommerce is playing a trick. When I load it initially everything goes fine.

As soon as I reload the "Home" the contents of the 'Categories' and the 'Manufacturers' change from the contents of my DB to 'www.dishop.com'.

I tried almost everything, including some tips from this topic. But am missing something.

Does anyone has a good lead?

 

Cheers

 

The lead of the day is that you are on a shared server and you are getting your /tmp directory mixed up with another site on the same server. Rename the /tmp directory and it should work. Or ask your host to set things up properly.

Share this post


Link to post
Share on other sites
Here is my htaccess file, it does the front end:

 

cheers and HTH someone:

# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
#   AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers

<IfModule mod_php5.c>
php_flag register_long_arrays on
</IfModule>

<IfModule mod_setenvif.c>
 <IfDefine SSL>
SetEnvIf User-Agent ".*MSIE.*" \
		 nokeepalive ssl-unclean-shutdown \
		 downgrade-1.0 force-response-1.0
 </IfDefine>
</IfModule>

# If Search Engine Friendly URLs do not work, try enabling the
# following Apache configuration parameter
#
# AcceptPathInfo On

# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)

<IfModule mod_php4.c>
 php_value session.use_trans_sid 0
 php_value register_globals 1
 php_flag display_errors On
 php_flag track_errors On
</IfModule>

Options +FollowSymLinks
RewriteEngine On 
RewriteBase /
# Eliminates www vs. non-www 
RewriteCond %{HTTP_HOST} ^domain\.com 
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L] 

# Eliminates duplicate home page i.e.: www.domain.com/index.php and www.domain.com appear as duplicate home page 

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ 
RewriteRule ^index\.php$ http://www.domain.com/ [R=301,L] 

# Skip the next two rewriterules if NOT a spider 
RewriteCond %{HTTP_USER_AGENT}!(msnbot�slurp�googlebot) [NC] 
RewriteRule .* - [S=2]

# case: leading and trailing parameters 
RewriteCond %{QUERY_STRING} ^(.+)&osCSid=[0-9a-z]+&(.+)$ [NC] 
RewriteRule (.*) $1?%1&%2 [R=301,L] 
# 
# case: leading-only, trailing-only or no additional parameters 
RewriteCond %{QUERY_STRING} ^(.+)&osCSid=[0-9a-z]+$�^osCSid=[0-9a-z]+&?(.*)$ [NC] 
RewriteRule (.*) $1?%1 [R=301,L]

 

cheers,

Peter M

 

Thanks Peter! That was very helpful :D :rolleyes:


Best Regards,

 

 

Victor Wise

Share this post


Link to post
Share on other sites

I've adjusted my files to point out all links to www.mydomain/mydir/ instead of www. mydomain/mydir/index.php

 

Becaus I'm on a Windows server I can't use the .htaccess method to redirect.

I already redirect (301) mydomain/ to www.mydomain/ with a php script in application_top.

 

Now I want to redirect www. mydomain/mydir/index.php to www. mydomain/mydir/.

Everything after /index.php ( like '?cName' and so on) should keep the index.php.

 

Could someone please help me with a 301 redirect php script (in index.php or application_top?) to achieve this?

 

TIA

Share this post


Link to post
Share on other sites

Can I just check that this following bit of code:

 

# Eliminates duplicate home page i.e.: www.domain.com/index.php and www.domain.com appear as duplicate home page

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/

RewriteRule ^index\.php$ http://www.put_your_domain_here.com/ [R=301,L]

 

Is the only bit that's actually needed to solve this problem?

Share this post


Link to post
Share on other sites

×