FAQ: mod_rewrite, 301 redirects, and optimizing Apache.

Discussion in 'Apache' started by Nintendo, Jul 30, 2005.

  1. movingconcierge

    movingconcierge Well-Known Member

    Messages:
    550
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    110
    #661
    I'm not even sure what you just said ;) but seriously, no. I can tinker and move things around, but I ain't no coder. I break things.

    BTW, thanks for the time, KingNin. My site pays homage to you.
     
    movingconcierge, Jun 18, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #662
    mod_rewrite only makes URLs work. You would have to know how to edit the script to have the keywords in the link with the spaces and special characters chanegd to for example -.

    And I have yet to touch da Nintendo Wee-wee!!! :D:D:D:D
     
    Nintendo, Jun 19, 2007 IP
    Crazy_Zap likes this.
  3. Cheap SEO Services

    Cheap SEO Services <------DoFollow Backlinks

    Messages:
    16,664
    Likes Received:
    1,318
    Best Answers:
    0
    Trophy Points:
    0
    #663
    Ninny!

    I need help!!!!

    I have mod-rewrite enabled on my server.
    .htaccess is chmod 777

    still can't edit files.



    HELP!!!!

    Col :)
     
    Cheap SEO Services, Jun 23, 2007 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #664
    I never chmod .htaccess unless da code needs to be generated via da web site, like with WordPress. Edit files on your computer and upload them via ftp!!!
     
    Nintendo, Jun 23, 2007 IP
  5. Cheap SEO Services

    Cheap SEO Services <------DoFollow Backlinks

    Messages:
    16,664
    Likes Received:
    1,318
    Best Answers:
    0
    Trophy Points:
    0
    #665
    That's what I am doing it for....Wordpress.

    Col :)
     
    Cheap SEO Services, Jun 23, 2007 IP
  6. mgrohan

    mgrohan Active Member

    Messages:
    671
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    58
    #666
    mgrohan, Jun 23, 2007 IP
  7. Ninbro

    Ninbro Banned

    Messages:
    54
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #667
    oh man you are the king man!
     
    Ninbro, Jun 23, 2007 IP
  8. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #668
    Make a post over on there forum. I *hate* WordPress mod_rewrite stuff!! It's like algebra_rewrite, instead of grade_2_rewrite!!!

    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^jobs/$ http://www.mysite.com/forums/viewforum.php?f=8 [R=301,L]
     
    Nintendo, Jun 23, 2007 IP
    mgrohan likes this.
  9. FOX LORE

    FOX LORE Notable Member

    Messages:
    8,118
    Likes Received:
    408
    Best Answers:
    0
    Trophy Points:
    230
    #669
    I don't know if this will help but it will rewrite the url for wordpress.



    Have you tried changing via Permalinks in Wordpress?

    You need an .htaccess like:

    
    Code:                                
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    Then Options , Permalink and custom .. I use
    
    Code:
    
    /%year%/%monthnum%/%day%/%category%/%postname%.html
    
    
    Code (markup):
    Lore
     
    FOX LORE, Jun 23, 2007 IP
  10. Cheap SEO Services

    Cheap SEO Services <------DoFollow Backlinks

    Messages:
    16,664
    Likes Received:
    1,318
    Best Answers:
    0
    Trophy Points:
    0
    #670
    Would you believe I am blocked from WP forums for whatever reason? I can't believe this. I have had plenty of hosting accounts and never had this problem before.

    Col :)
     
    Cheap SEO Services, Jun 23, 2007 IP
  11. mgrohan

    mgrohan Active Member

    Messages:
    671
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    58
    #671
    Thanks Nintendo for help with the redirect.

    Had a htaccess in my other folder which was causing conflicts. Works great now!

    Rep added :)
     
    mgrohan, Jun 24, 2007 IP
  12. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #672
    Run over to *gags* webmasterworld.com/apache/

    Da Apache King is over there.
     
    Nintendo, Jun 25, 2007 IP
  13. Xuxa

    Xuxa Banned

    Messages:
    248
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #673
    @ Nintendo

    Can you please help me rewrite my URLs, I want them to look a different way.

    Before: (without rewrite)
    After: (how I want them to look)
    That is only a few of them, I want changed. But if you help, me and I see your example, I would be able to do the rest on my own.

    Thanks.
     
    Xuxa, Jun 27, 2007 IP
  14. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #674
    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^aboutus/([^.]+)/$ aboutus/$1.php [L]

    Rename why_us.php to why-us.php
     
    Nintendo, Jun 27, 2007 IP
  15. Xuxa

    Xuxa Banned

    Messages:
    248
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #675
    That didn't work. When I added that, the /aboutus/ linked to the home page, and the images didn't show up.
     
    Xuxa, Jun 28, 2007 IP
  16. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #676
    Image HTML code has to be changed as if the URLs are correct. Same with css.

    RewriteRule ^aboutus/$ aboutus/index.php [L]
     
    Nintendo, Jun 28, 2007 IP
  17. Xuxa

    Xuxa Banned

    Messages:
    248
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #677
    How would the image codes, have to look?

    Is there a way to mod_rewrite the images path, so I don't have to update every page and css file?
     
    Xuxa, Jun 28, 2007 IP
  18. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #678
    Using the full image URL is the easiest way.
     
    Nintendo, Jun 28, 2007 IP
  19. Xuxa

    Xuxa Banned

    Messages:
    248
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #679
    Xuxa, Jun 28, 2007 IP
  20. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #680
    RewriteRule ^aboutus/([^.]+)$ aboutus/$1.php [L]

    if you don't want the /
     
    Nintendo, Jun 28, 2007 IP