|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
viportals.com/index.php?params=links/1/
to viportals.com/links/1 HOWEVER params=links/1/ may have varying lengths, such as http://www.viportals.com/index.php?params=links/out/77/ but i want the .htaccess to kick in when there is 1 or more. this is a bit out of my league, but i'll show you what i have so far: Code:
RewriteRule viportals.com/((.+/)+) viportals.com/index.php?params=$N just my shot at it. i'm trying to learn .htaccess, but its very hard. if any1 can refer me to a good tut link (in english) i'd appreciate it. |
|
#2
|
||||
|
||||
|
Did you see the MOD REWRITE sticky in this forum?
Would you please provide several examples of what you expect to happen and what you don't want to have happen? It would be best if they were in this format: Code:
/links/1 -> /index.php?params=links/1/
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
|
#3
|
|||
|
|||
|
sure.
Code:
/users/username/1/DESC -> /index.php?params=users/username/1/DESC/ /request -> /index.php?params=request /category/Shooting/1 -> /index.php?params=category/Shooting/1/ the closes example in the guide is: Code:
domain.com/name1/value1/name2/value2/nameN/valueN -> domain.com/foo.php?name1=value1&name2=value2&nameN=valueN here is how he did it: Code:
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.+)/([^/]+)/([^/]+)$ $1?$2=$3 [QSA,E=TEST:$1]
RewriteCond %{ENV:TEST} ^(.+)/([^/]+)/([^/]+)$
RewriteRule ^.*$ %1?%2=%3 [QSA,E=TEST:%1,N]
RewriteCond %{ENV:TEST} ^([^/]+)/(.+)$ [OR]
RewriteCond %{REQUEST_URI} ^/([^/]+)/(.+)$
RewriteRule ^.*$ foo.php?%1=%2 [QSA,L]
wait a minute... he = you... that means... wow, ur a legend! |
|
#4
|
||||
|
||||
|
You're complicating things
I think Example 3 should work. |
|
#5
|
|||
|
|||
|
no see my case is weird
/index.php?params=asdf/dsa/fd/sa/fd/saf/dsafdsafdsa/f/dsa/ |
|
#6
|
||||
|
||||
|
So just change "terms" to "params":
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php?params=$1 [L]
|
|
#7
|
|||
|
|||
|
wow no way! ur amazing man! i guess i shuda seen that, but i forgot that you could just take the last part and use it. thats awesome. thanks so much!
|
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Viportals.com/index.php?params=links/1/ -> viportals.com/links/1 w/ .htaccess? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|