I would like to point this url: /0007149921/The-Pale-Horseman.php to /product.php?id=$1 Although the name of the file could be any e.g. /0007149921/The-random-name.php - I am only interested in the id / number part for url My lame attempt: RewriteRule ^([A-Za-z0-9]+)/$ /product.php?num=$1 Any clues? Thanks for any help, Joe
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)/$ product.php?num=$1 [L]
Thanks for the swift reply. I have tried your answer and no joy. Does the [^.] mean any character(s)? If this is so, then my solution and yours are very similar RewriteRule ^([A-Za-z0-9]+)/$ /product.php?num=$1 works for the url: mydomain.com/0007149921/ but not for mydomain.com/0007149921/The-Pale-Horseman.php Is there somekind of wildcard symbol i need? "RewriteRule ^([A-Za-z0-9]+)/$ /product.php?num=$1" doesn't $ symbolise the end of the string...... ?? Thanks for help, Joe
Try (.*). If that doesn't work try a test XBitHack Full Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^index\.page$ index.html [L] with index.html being the index file and then go to domain.com/index.page and see if it shows the index page.
Hi all, All pages in test enviroment are OK, but doesn't work after uploaded in real enviroment? Anybody can help me? Thank a lot.
is the [L] required after every rule? i only have it after my first rule and things seem to be working i would change it but i dont want to fix what isnt broken thanks
This thread and the AdSense/YPN FAQs are just to help save me from being banned for being an annoying wacko!!! I've done mod_rewrite with out the [L].
Best thread and learn at least some thing about mod_rewrite. BTW any difference between ForceType and Mod_rewrite OR its same thing, If there is difference what are pros and cons of each while comparing. Thanks Nintendo for Super thread.
There's a big difference between changing the URLs and for example making all files be images. # force all files to be image/gif: <Location /images> ForceType image/gif </Location>
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^browse/([^.]+)\.html$ index.php?browse=/$1/ [L] or if that doesn't do it.... Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^browse/([^.]+)([^.]+)/([^.]+)/([^.]+)/([^.]+)/([^.]+)\.html$ index.php?browse=/$1/$2/$3/$4/$5/ [L] RewriteRule ^browse/([^.]+)([^.]+)/([^.]+)/([^.]+)/([^.]+)\.html$ index.php?browse=/$1/$2/$3/$4/ [L] RewriteRule ^browse/([^.]+)([^.]+)/([^.]+)/([^.]+)\.html$ index.php?browse=/$1/$2/$3/ [L] RewriteRule ^browse/([^.]+)([^.]+)/([^.]+)\.html$ index.php?browse=/$1/$2/ [L] RewriteRule ^browse/([^.]+)\.html$ index.php?browse=/$1/ [L]
For a test, do Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^wacko\.html$ index.php [L] and see if http://www.directory.cjb.net/wacko.html shows the index page.
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^browse/([^.]+)\.html$ index.php?browse=/$1/ [L] and see if http://www.directory.cjb.net/browse/Health.html works.