Closed Thread
Results 1 to 6 of 6

Thread: mod_rewrite on .htaccess

  1. #1
    phpforfun's Avatar
    phpforfun is offline Speaks fluent binary
    Join Date
    Feb 2008
    Posts
    1,232
    Blog Entries
    17
    Rep Power
    24

    mod_rewrite on .htaccess

    So I just started using mod_rewrite, and it seems to be working great, this is what I setup:
    options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^(.*)-group(.*).html index.php?view=$1&group=$2
    RewriteRule ^(.*)-(.*)-(.*).html index.php?view=$1&subView=$2&to=$3
    RewriteRule ^(.*)-(.*).html index.php?view=$1&subView=$2
    RewriteRule ^(.*).html index.php?view=$1
    Thus "hosting-unlimited.html" will lead to "?view=hosting&subView=unlimited"
    BUT.. now the 404 wont work
    Example: http://amphosted.com/asdfasdfasdf Should be a 404.
    Also.. Amp Hosted - Main is actually a path I need to be viewed, it shows a tutorial on using rvsitebuilder, but when I use mod_rewrite, it doesnt work, it shows the index.php page of the path before, obviously deformed in the fact that the script paths are incorrect.

    Any ideas on how to fix this?
    Checkout my new forum! http://adminreference.com/

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Make a custom 404 page or whatever and then in the .htaccess add this

    Code:
    ErrorDocument 404 /Your404Page.html

  4. #3
    mop
    mop is offline Learning Programmer
    Join Date
    Apr 2008
    Posts
    30
    Rep Power
    0
    That is what I was going to suggest as well.

  5. #4
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Well, I used that myself on my website... Although if I remember correctly the default 404 still worked for me.. I just made those custom pages just because I wanted.. not because it did not work... I don't know why that is happening... maybe some settings are not correct on your server..

  6. #5
    phpforfun's Avatar
    phpforfun is offline Speaks fluent binary
    Join Date
    Feb 2008
    Posts
    1,232
    Blog Entries
    17
    Rep Power
    24
    Yeah, the default 404 should still work, as well as
    Amp Hosted - Main Because its an actual index page, but it does't, but links that arent real look the same, like
    http://amphosted.com/asdfjasdklfjkkjdsjjdjdjjjjdjdjd,

    Edit:, I changed index.html to index.php and it works, but index.html should still work
    Checkout my new forum! http://adminreference.com/

  7. #6
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Hmm, that's strange... how come the .html did not work...

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. mod_rewrite - some problem with this method
    By AdrianWierciochPHP in forum PHP Development
    Replies: 3
    Last Post: 01-18-2011, 07:04 PM
  2. Replies: 2
    Last Post: 05-11-2009, 08:31 AM
  3. Mod_rewrite on .htaccess
    By phpforfun in forum General Programming
    Replies: 5
    Last Post: 11-28-2008, 03:22 PM
  4. .htaccess help
    By blackplastic in forum PHP Development
    Replies: 2
    Last Post: 05-03-2008, 06:26 AM
  5. Apache's mod_rewrite
    By PC101 in forum Search Engine Optimization
    Replies: 2
    Last Post: 09-19-2006, 06:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts