Welcome Guest Search | Active Topics | Log In | Register

URL rewrite with linux server (Apache) Options · View
joppiesaus
#1 Posted : Wednesday, October 15, 2008 11:33:51 AM

Rank: YAF Forumling


Joined: 10/15/2008
Posts: 1
Location: Netherlands
Hello,

I am currently working on a new webshop at which i want to rewrite a dynamic URL.

Currently the UL looks like this:

http://www.mysite.nl/pro...at&slug=super%20hat

I want to make it look like this:

http://www.mysite.nl/hat/red-hat/super-hat/

However, I cannot get this to work!

I currently have this code running which always makes sure the URL starts with "http://www.":

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.mysite\.nl$ [NC]
RewriteRule ^(.*)$ http://www.mysite.nl/$1 [R=301,L]

THIS CODE WORKS FINE! Smile I want to use this code to rewrite the URL:

RewriteRule http://www.mysite.nl/(.*)/(.*)/(.*)/ product.php?categorie=$1&subcategorie=$2&slug=$3


So the .htaccess file looks like this:


Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.mysite\.nl$ [NC]
RewriteRule ^(.*)$ http://www.mysite.nl/$1 [R=301,L]
RewriteRule http://www.mysite.nl/(.*)/(.*)/(.*)/ product.php?categorie=$1&subcategorie=$2&slug=$3


However, this doesn't seem to work. Can anybody help me?

Also, I understand that this is just a first step, eventually ill need php to rewrite the URL's in the code aswell..
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 RC2 | YAF © 2003-2008, Yet Another Forum.NET
This page was generated in 0.059 seconds.

SourceForge.net Logo Powered by ASP.NET v2.0 411ASP.NET