0

Hi all! I have dug through the heaping amounts of mod_rewrite threads here and elsewhere and have come to no end!

I am wondering if this is not working because:
A) 1&1 Hosting is garbage.
B) Its on a subdomain.

Here is my code.

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?username=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ profile.php?username=$1

Essentially I want it to work like this
http://wishlist.mellowmedia.ca/Dave points to http://wishlist.mellowmedia.ca/profile.php?username=Dave

Any ideas?

3
Contributors
3
Replies
6
Views
7 Years
Discussion Span
Last Post by diafol
1

Hey.

I don't see a problem in the rules. Even tried it and it worked fine on my test server.

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^([a-zA-Z0-9_-]+)/?$ profile.php?username=$1
</IfModule>

Note that I combined the two rules into a single rule. The /? at the end there means: 0 or 1 forward-slash. Doesn't really change anything tho, except saves you the extra line.

The sub-domain thing shouldn't have any effect on this. Maybe it is a problem with your host?

Edited by Atli: n/a

1

Re hosts:

If you've got a budget package, very often you don't get the full control. For htaccess, you may need to upgrade. Some hosts request that you send them the htaccess file and they will put it up for you.

HOWEVER.

It could be that you uploaded the .htaccess file with that filename. This can often mess up the file. Try uploading again as htaccess.txt (via FTP) and then renaming it .htaccess.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.