NameSilo

Mod_rewrite?...Anyone know anything?

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
NamecheapNamecheap
Watch

adam_uk

Established Member
Impact
20
hey people

i have a dynamic site and im trying to googlfy it

at the moment when you visit a site

its /index.htm?q=view&id=324

for example now what i need to do is to get somthign like this sorted

/view/342.htm

but on the same file i have things like search results etc etc so i need to go to something like

/search/searhterm.html instead of ?q=search&search=search term

anyone got any resorces, code tips? etc to get me started

thanks
adam
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Trial and error is the best way to learn mod rewrite. There are some ok tutorials you can find through Google search, sorry I don't have any bookmarked.

Your .htaccess file is going to look similar to this for those examples your provided.

Code:
RewriteEngine On

RewriteRule ^view/(.*).htm /index.htm?q=view&id=$1
RewriteRule ^/search/(.*).html ?q=search&search=$1

ErrorDocument  404  /index.htm
 
0
•••
0
•••
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back