...

View Full Version : .htaccess 'mod_rewrite' not working



bucket
04-30-2011, 07:04 AM
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:


RewriteEngine On
RewriteRule ^([a-zA-Z0-9_'-]+)\.ws$ $1.php


The thing is, it doesnt work, it keeps saying:



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.

m4rc3
05-09-2011, 08:21 PM
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

Inigoesdr
05-09-2011, 11:33 PM
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. :)

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.

m4rc3
05-10-2011, 01:19 AM
my bad :/
Sorry to add confusion to the mix



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum