We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
mod_rewrite & .htaccess; for clean URL's
Topic Started: May 12 2005, 03:24 PM (373 Views)
Rory
i;m a mess
[ *  *  *  *  *  *  * ]
Ok, try as i might, i can't get this to work.

I have the following on a host:

http://domain.com/temp/sitename/

i want it so that if you enter:

http://domain.com/temp/sitename/content/categoryname/page

it actually goes to:
http://domain.com/temp/sitename/content.ph...yname&page=page

but you only see the first url.

I can't seem to get my .htaccess to work :s
Code:
 
RewriteEngine On
RewriteRule ^content/([A-Za-z]+)/([A-Za-z]+)/$ content.php?category=$1&page=$2


Does anyone have a clue? i get a 404 error, even though content.php is on the server.
Offline Profile Quote Post Goto Top
 
Rory
i;m a mess
[ *  *  *  *  *  *  * ]
after a bit more searching (bah @ 40 mins in total) here is how i got it to work:

Code:
 
RewriteEngine On
RewriteRule ^content/([a-z]+)/([a-z]+)?$ content.php?category=$1&page=$2 [L]



silly regular expressions... i had a / instead of a ? :D
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply