CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Apache configuration (http://www.codingforums.com/forumdisplay.php?f=69)
-   -   Rewrite rewritten url (http://www.codingforums.com/showthread.php?t=282561)

Trki 11-19-2012 03:28 PM

Rewrite rewritten url
 
Hi ... i am confused

I have this

PHP Code:

RewriteEngine On

RewriteRule 
^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ index.php?var1=$1&var2=$2&var3 [L]
RewriteRule ^([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)$ index.php?var1=$1&var2=$2&var3=$[L]
RewriteRule ^([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)$ index.php?var1=$1&var2=$[L]
RewriteRule ^([a-zA-Z0-9]+)$ index.php?var1=$[L

Which works gr8...

And it creates url like this

http://domain.com/blog/Trki

which is gr8 but i dont want to display this /blog/Trki

My dreamed url should looks like this: http://domain.com/Trki

I tried something like this

RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)$ index.php?var2=$2 [L]

( i removed the first part but i think it was pretty poor try) :P hm? :)

PS: i want to do it just when the 'var1' == blog

or something like this works too good

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?var1=blog&var2=$1

but here is the problem that.. if i want to visit /Home .. it takes it like var1=blog&var2=home... i could make some conds. like urls who matchs home or contact or whatever will be redirected but its not practical.

poyzn 11-19-2012 08:59 PM

you have to pass the entire uri to the script (index.php in your case) and then parse it in it

Trki 11-19-2012 09:25 PM

Quote:

Originally Posted by poyzn (Post 1293242)
you have to pass the entire uri to the script (index.php in your case) and then parse it in it

hm.. sorry what? :)


okay i have solved it in different way using php when there was no replies :P


All times are GMT +1. The time now is 01:40 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.