2009-10-03 5 views
0

Comment puis-je réécrire l'URL suivante:Comment réécrire des URL en utilisant htaccess?

http://www.myurl.com/job/Accounting-Clerk-at-Department-of-Workforce-Services-in-Salt-Lake-City,-UT-1b6117567108f5a2 

Dans ces composants:

query = Accounting Clerk; 
cmp = Department of Workforce Services; 
location = Salt Lake City, UT; 
key = 1b6117567108f5a2; 

Pour obtenir ce résultat:

index.php?q=$query&cmp=$cmp&l=$location&key=$key 
+0

Je ne pense pas que vous avez besoin tellement indésirable dans votre URL – UpTheCreek

+6

« Apprends-moi » ne sont pas le genre de questions que nous voulons ici. – Marius

+3

Travaillez-vous pour Indeed? http://www.indeed.com/job/Accounting-Clerk-at-Department-of-Workforce-Services-in-Salt-Lake-City,-UT-1b6117567108f5a2 – Gumbo

Répondre

1
RewriteEngine on 
RewriteBase/

RewriteRule job/([^.]+)-in-([^.]+) index.php?var1=$1&var2ext=$2 

etc continuer comme ça

4

Essayez cette règle mod_rewrite:

RewriteEngine on 
RewriteRule ^job/([^/]+)-at-([^/]+)-in-([^/]+)-([0-9a-f]+)$ index.php?q=$1&cmp=$2&l=$3&key=$4