Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    824
    Thanks
    93
    Thanked 18 Times in 18 Posts

    Apache adding .php to register URL

    Here's my current .htaccess file
    Code:
    RewriteEngine On
    
    
    
    RewriteRule ^([.*]+)/_css - [L,NC]
    #Force trailing slash
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !index.php
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ /$1/ [L,R=301] 
    
    #Rules for the forum (with/without the topic title)
    RewriteRule ^forum/([a-z_-]+)/([0-9]+)/$ /topics.php?ID=$2 [NC]
    RewriteRule ^forum/([0-9]+)/$ /topics.php?ID=$1
    RewriteRule ^forum/$ /topics.php?ID=0
    
    
    #Rules for posts (with/without the topic or post title)
    RewriteRule ^forum/([a-z_-]+)/([0-9]+)/post/([a-zA-Z_-]+)/([0-9]+)/$ /posts.php?postID=$4 [NC]
    RewriteRule ^forum/([0-9]+)/post/([a-zA-Z_-]+)/([0-9]+)/$ /posts.php?postID=$3 [NC]
    RewriteRule ^forum/([a-zA-Z_-]+)/([0-9]+)/post/([0-9]+)/$ /posts.php?postID=$3 [NC]
    RewriteRule ^post/([0-9]+)/$ /posts.php?postID=$1
    RewriteRule ^post/([a-zA-Z_-]+)/([0-9]+)/$ /posts.php?postID=$2 [NC]
    
    #Rules for users
    RewriteRule ^user/([a-zA-Z]+)/([0-9]+)/$ /index.php?userID=$2
    
    #Rules for adding posts
    RewriteRule ^add/([0-9]+)/$ /add.php?addPost=$1
    RewriteRule ^add/post/([0-9]+)/$ /add.php?addPost2=$1
    
    #Rules for adding replies
    RewriteRule ^add/reply/([0-9]+)/$ /index.php?addReply=$1
    RewriteRule ^add/reply2/([0-9]+)/$ /index.php?addReply2=$1
    
    #Rules for registering
    If works fine for everything so far, however when i go to the URL domain.com/register it changes it automatically to domain.com/register.php/ and I have no idea at all why :s.

    Can anybody help?

    Its only register whats doing this, any other URL, works as it should

  • #2
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    do you really need that?
    on my dev server (apache2/php5 running on ubuntu server) apache would show domain.com/document.php when you type in domain.com/document if only such document exists in given directory
    it's not moded apache2 from ubuntu repo without any extra rewrite rooles


  •  

    Posting Permissions

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