URL rewrite please help

Discuss practical ways rearrange URLs using mod_rewrite.

URL rewrite please help

Postby kellogs » Thu Nov 06, 2008 6:56 pm

This is the dynamic URL

http://www.domain-example.com/accounts. ... ode=browse

Could you kindly shows me to write it to directory style

http://www.domain-example.com/accounts/wow/browse

Thank you!
kellogs
 
Posts: 5
Joined: Thu Nov 06, 2008 6:51 pm

Postby dj_spykey » Fri Nov 07, 2008 4:02 am

Code: Select all
RewriteEngine on

RewriteRule accounts/(.*)/(.*) accounts.php?gametag=$1&mode=$2

dj_spykey
 
Posts: 8
Joined: Mon Nov 03, 2008 11:39 pm

Postby richardk » Fri Nov 07, 2008 11:46 am

Try
Code: Select all
Options +FollowSymLinks -MultiViews

RewriteEngine On

RewriteRule ^accounts/([^/]+)/([^/]+)/?$ /accounts.php?gametag=$1&mode=$2 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby kellogs » Fri Nov 07, 2008 6:47 pm

Dj Spikey

It does not work ... i have tested that before :)

Richard

It does not work ... the url was never re written

Could you help please or is there any information you need?
kellogs
 
Posts: 5
Joined: Thu Nov 06, 2008 6:51 pm

Postby kellogs » Sun Nov 09, 2008 5:03 am

sorry it does not ...

but now all the images and css is broken

may i know what should i do?
kellogs
 
Posts: 5
Joined: Thu Nov 06, 2008 6:51 pm

Postby kellogs » Sun Nov 09, 2008 5:26 am

It is rewriting user request URL

how about rewrite server generated URL?
kellogs
 
Posts: 5
Joined: Thu Nov 06, 2008 6:51 pm

Postby richardk » Sun Nov 09, 2008 11:53 am

now all the images and css is broken

FAQ: Relative paths to images, JavaScript, CSS and other external/linked files are broken.

It is rewriting user request URL

how about rewrite server generated URL?

Mod_rewrite does not change the links outputted by your script, you have to edit your script to change their output.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 25 guests

cron