Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member thuffner's Avatar
    Join Date
    May 2003
    Posts
    165
    Member #
    1363
    Hello everyone. I am having some issues my .htaccess mod_rewrite and was wondering if someone could help.

    Here is my .htaccess file:

    Code:
    AddType application/x-httpd-php .shtml
    ErrorDocument 404 /404error.shtml
    
    RewriteEngine on
    
    RewriteRule ^$ /index.php
    
    RewriteRule ^bloopers$ /bloopers.php [R]
    RewriteRule ^bloopers/.* /bloopers.php%{PATH_INFO} [R]
    
    RewriteRule ^reviews$ /reviews.php
    RewriteRule ^reviews/.* /reviews.php%{PATH_INFO}
    
    RewriteRule ^games$ /games.php
    RewriteRule ^games/([0-9a-z]*).shtml$ /games.php/$1
    
    RewriteRule ^newsarchives/category/([0-9a-z]*).shtml /newsarchives/category.php/$1 [R]
    
    RewriteRule ^news$ / 
    RewriteRule ^news/([0-9]*).shtml$ /news.php/$1 [L]
    
    RewriteRule ^titles$ /titles.php
    RewriteRule ^titles/.* /titles.php%{PATH_INFO}
    
    RewriteRule ^firsts$ /firsts.php
    RewriteRule ^firsts/.* /firsts.php%{PATH_INFO}
    
    RewriteRule ^tidbits$ /tidbits.php
    RewriteRule ^tidbits/.* /tidbits.php%{PATH_INFO}
    
    RewriteRule ^bannergallery$ /bannergallery.php
    RewriteRule ^bannergallery/.* /bannergallery.php%{PATH_INFO}
    
    RewriteRule ^skins.shtml /skins.php
    RewriteRule ^skins2.shtml /skins/index2.shtml
    RewriteRule ^skins/index([0-9]*).shtml /skins.php/index$1.shtml
    RewriteRule ^skins$ /skins.php
    
    RewriteRule ^opinion$ /opinion.php
    RewriteRule ^opinion/$ /opinion.php
    RewriteRule ^opinion/([0-9]*).shtml /opinion.php/$1
    RewriteRule ^opinion/index.shtml /opinion.php
    
    RewriteRule ^reviews$ /reviews.php
    RewriteRule ^reviews/.* /reviews.php%{PATH_INFO}
    
    RewriteRule ^sounds$ /sounds.php
    RewriteRule ^sounds/([0-9a-z]*).shtml /sounds.php/$1.shtml
    
    RewriteRule ^stills$ /stills.php
    RewriteRule ^stills/.* /stills.php%{PATH_INFO}
    
    RewriteRule ^bondstore(/)?$ /bondstore.php
    RewriteCond %{REQUEST_URI} !^/bondstore/bondmovies.shtml
    RewriteCond %{REQUEST_URI} !^/bondstore/posters.shtml
    RewriteCond %{REQUEST_URI} !^/bondstore/photos.shtml
    RewriteRule ^bondstore/([0-9a-z]*).shtml /bondstore.php/$1.shtml [R]
    
    RewriteRule ^movies$ /movies.php
    RewriteRule ^movies/.* /movies.php%{PATH_INFO}
    RewriteRule ^([0-9a-z]*)$ /movies.php/$1.shtml [R]
    RewriteRule ^movies.shtml$ /movies.php
    <Files php.ini>
    order allow,deny
    deny from all
    </Files>
    Options +Indexes
    IndexOptions -FancyIndexing
    These are the issues I am having:

    1. In my Movie Profiles (http://www.bondmovies.com/movies.shtml) section: When someone visits a movie's profile (http://www.bondmovies.com/moviename), the URL changes for some reason (it's in my code but I am not sure how to fix), to http://www.bondmovies.com/movies.php/moviename.shtml

    Instead of this, I would like the page URL to remain the same (http://www.bondmovies.com/moviename) as well as have the ability to access the page with a trailing slash, like this: http://www.bondmovies.com/moviename/

    2. I am having a similar issue with sections of my Bond Store (http://www.bondmovies.com/bondstore/bondstore.shtml), where URLs in the format http://www.bondmovies.com/bondstore/page.shtml change to http://www.bondmovies.com/bondstore.php/page.shtml when I don't want them to.

    I have had this issue for a while now, and would GREATLY appreciate some help on this, as I am not well versed in .htaccess and mod_rewrite.
    BondMovies.com - "Nobody Does It Better."

  2.  

  3. #2
    Member
    Join Date
    Apr 2007
    Posts
    96
    Member #
    15165
    Quote Originally Posted by thuffner
    I have had this issue for a while now, and would GREATLY appreciate some help on this, as I am not well versed in .htaccess and mod_rewrite.
    http://www.yourhtmlsource.com/sitema...rewriting.html

  4. #3
    ljm
    ljm is offline
    Senior Member ljm's Avatar
    Join Date
    Aug 2006
    Location
    Manchester, England
    Posts
    284
    Member #
    13684
    Liked
    1 times
    The lines with [R] at the end mean the first URL is redirected to the second, rather than rewritten. That, coupled with the fact you stated the file extension for the second URL in the same rule, means you're getting a URL you don't want.

    Try removing the file extensions from the second URL on the lines where there is [R] at the end.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:32 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com