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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    697
    Thanks
    8
    Thanked 17 Times in 16 Posts

    .htaccess 'mod_rewrite' not working

    Hey guys I am in need of some help im trying to put a new extention on files that I have currently named .php

    I am trying to set them as .ws files instead. This is how my htaccess look like atm:

    Code:
    RewriteEngine On
    RewriteRule ^([a-zA-Z0-9_'-]+)\.ws$ $1.php
    The thing is, it doesnt work, it keeps saying:


    Code:
    Object not found!
    
    The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
    
    If you think this is a server error, please contact the webmaster.
    Error 404
    localhost
    04/30/11 00:56:48
    Apache/2.2.13 (Win32) PHP/5.2.10
    So I am in need of help, I am using EASYPHP, and edited httpc file or w/e that apache file is called and removed the # from the line to enable mod_rewrite, the problem is, it still doesnt work..

    Also, I also only removed the comment from 1 line not 2, becasuse the 2nd line I have no uncomment is not there.

    Thanks for the upcoming help.
    MY MSN: Sith717@Hotmail.com
    PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
    PM me anytime for HTML, PHP or web design help. I will be glad to help you out.

  • #2
    New to the CF scene
    Join Date
    May 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i think you have it backwards,

    RewriteRule Pattern Substitution

    if the files are .php and you want the url to show them as .ws you have to do soemthing like this.

    RewriteRule (.*).php$ $1.ws

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    bucket, your code works for me. You may want to escape that hyphen, but it didn't make a difference for me(linux-based Apache). Make sure you have mod_rewrite installed too.
    Quote Originally Posted by m4rc3 View Post
    i think you have it backwards,

    RewriteRule Pattern Substitution

    if the files are .php and you want the url to show them as .ws you have to do soemthing like this.

    RewriteRule (.*).php$ $1.ws
    That is incorrect. You are thinking about it the wrong way. You aren't replacing what data is coming in, you are matching the data that comes in and rerouting where it goes to.

  • #4
    New to the CF scene
    Join Date
    May 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    my bad :/
    Sorry to add confusion to the mix


  •  

    Posting Permissions

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