By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,746 Members | 1,928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,746 IT Pros & Developers. It's quick & easy.

Mod Rewrites

P: 16
I tried using the mod Rewrite feature by turning on the rewrite engine and using it in the htaccess file. I contacted my web hosting company and they said windows users cannot use the htaccess file and I would have to purchase software in order to use mod rewrite. Does anyone know another way to do rewrites outside of the htaccess file ?
Feb 27 '08 #1
Share this Question
Share on Google+
8 Replies


Markus
Expert 5K+
P: 6,050
Do you have to purchase this 'software' from them?

Robbing %#!"#!%

Unfortuantely, i have not heard of any other way of achieving mod_rewrites outside of htaccess.

Hopefully someone else has!
Feb 27 '08 #2

ronverdonk
Expert 2.5K+
P: 4,258
I have no experience with rewrite outside Apache, but I found an entry in the phpclasses.org site, where the developer claims that it works with and without Apache. So have look HERE and see if it is useable for you.

Ronald
Feb 27 '08 #3

P: 16
I took a look at this and it seems it does require an Apache server. I am thinking about purchasing the mod rewrite license for the Windows Server environment. If anybody knows a way to do the rewrites outside of Apache let me know, it will save me a few bucks.
Feb 29 '08 #4

P: 16
ronverdonk, one other question, from what you know about mod rewrites on Apache tell me if this is possible:
Say I have a page that brings up a users information. i.e.
www.mysite.com/results.php?user=1

The mod rewrite can write it out like:
www.mysite.com/user1/

My question: Can I then use the url www.mysite.com/user1/ to access the page directly that give would give me the users information. In other words would www.mysite.com/user1/ execute www.mysite.com/results.php?user=1
Feb 29 '08 #5

Markus
Expert 5K+
P: 6,050
My question: Can I then use the url www.mysite.com/user1/ to access the page directly that give would give me the users information. In other words would www.mysite.com/user1/ execute www.mysite.com/results.php?user=1
It would indeed.
Just use
[php]
$_GET['user'];
[/php]
To retrieve it.
Feb 29 '08 #6

100+
P: 103
I tried using the mod Rewrite feature by turning on the rewrite engine and using it in the htaccess file. I contacted my web hosting company and they said windows users cannot use the htaccess file and I would have to purchase software in order to use mod rewrite. Does anyone know another way to do rewrites outside of the htaccess file ?
I use windows and apache (local) and linux/apache (live) and I use .htaccess.

Maybe they are referring to the point that Windows doesn't like .htaccess because it starts will a "."

I can save .htaccess correctly with context - www.context.cx - probably the same with most text editors except notepad?

err...if you want the functionality of mod_rewrite on IIS then I suppose that's another question - I'm sure I read that you can. Or just switch to a host with Apache.
Feb 29 '08 #7

P: 16
I instaled the mod rewrite feature for IIS. Now I am trying to use it and cannot get to work
.
Example:
I want the mod rewrite to execute
www.mysite.com/results.php?user=20
when a user types in the following:
www.mysite.com/user20/

Is this the correct code to get this to work ?

Code(php):
RewriteEngine on
RewriteRule ^([.*])/$ results.php?user=$1 [L]
Mar 4 '08 #8

P: 16
I did get this working but one problem I am having is it pulls up the page ok but the header and footer do not look correct. Does the htaccess file have to exist in subfolders for files that are not in the root directory. How is this handled ?
Mar 4 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.