Dynadot โ€” .com Registration $8.99

Mod_rewrite help

Spaceship Spaceship
Watch

KwelX

Established Member
Impact
21
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
simple steps:

requirements: your host needs mod_rewrite to be installed. if not, ask them otherwise move hosts if this is important for you.

Code:
RewriteEngine on
RewriteRule ^joke/joke-(.*).html view.php?joke=$1

the problem is with the script, you have change some settings in order to view the name. otherwise it wont work. and it will work like this:

Code:
joke/joke-745.html
 
0
•••
theres a way where you can do with out causing to much trouble

when you create the links with php echo out the title into the url but first remove any non alphanumeric chars from the title so its just letters and numbers replace spaces with _

so your links will look something simiar to this:
joke-how_many_chickens_crossed_the_road-252.html

then you will have a rewrite rule like this
RewriteEngine on
RewriteRule ^joke/joke-(.*)-(.*).html view.php?joke=$2

if all goes well it should work
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Unstoppable Domains
Domain Recover
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back