RewriteRule ^category-([0-9]*)/$ category.php?t=$1 [L,NC] if your just trying to change it from .html to a directory Only way I know how to generate a 404 is to delete the files, and if you want to, redirect all the 404 pages to a certian URL, using a code like ErrorDocument 404 /file.html
Nintendo, after applying the mod_rewrite, everything was fine unless that it shows error code of 500 to some engine. for example: http://whois.sc/hotwebtools.com **does this effect googlebot from crawling? Thanks
i have several folder, every folder got its own .htaccess. This is one of them ------------------------ Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^viewArticles/(.*)/(.*)/(.*)\.html$ articles/viewArticles.php?aID=$1&subCatID=$2&catID=$3 [L] RewriteRule ^subCat/(.*)/(.*)\.html$ articles/subCat.php?subCatID=$1&catID=$2 [L] RewriteRule ^subCatMore/(.*)/(.*)\.html$ articles/subCat.php?set=$1&subCatID=$2 [L] RewriteRule ^category/(.*)\.html$ articles/cat.php?catID=$1 [L]
Okay so for the first and last time I would also like to eat some brains of Nitendo. I have this URLS. http://resource.bluesoftweb.com/view.php?ItemID=117 http://resource.bluesoftweb.com/ShowCategory.php?CategoryID=17 So what should I do to make it static. Please help me. This show thing that is truncated is 'ShowCategory.php?CategoryID=17'
How do you want the static URLs to look like? Gah!!!! Nitendo...how many more names will they come up with!!!! You would think that with Nintendo being so populer, every one would give me one name, yet I'm da only one here with more than one name. Geting closer to 10 names now!!!! *Thinks I should of just registered as 'Wacko'!!!!!
Anything you say. I don't care what they look like as long as they look static to SE's and sorry for that name thing. "NINTENDO" this time I am sorry for that. Also thanks for replying so fast.
http://resource.bluesoftweb.com/item/117.html http://resource.bluesoftweb.com/category/17.html Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^item/([^.]+)\.html$ view.php?ItemID=$1 [L] RewriteRule ^category/([^.]+)\.html$ ShowCategory.php?CategoryID=$1 [L]
Are you god of mod_rewrite. Thanks. Thank You very much. I think you have invented this mod_rewrite thing.
And also let me know that would I have to edit the whole script for this thing to work. Means all the links in my pages. that currently point to the dynamic URL.
What ever script you use has to be changed to link to the new URLs! mod_rewrite only makes the cool URLs work! domain.com/.htaccess is where that code goes.
Okay will think about it.. Too much work to be done I think so. Can't I write something that would point directly to the new url's in my cinfig.php which is included on every page?
one thing more that I forgot to ask what will come in .htaccess For this: http://localhost/articles/ShowCategory.php? CategoryID=17&SubcategoryID=44 Thanks. I wrote this is it correct? RewriteRule ^subcategory/([^.]+)\.html$ ShowCategory.php?CategoryID=$1&SubcategoryID=$2 [L]
RewriteRule ^category/([^.]+)/subcategory/([^.]+)\.html$ articles/ShowCategory.php?CategoryID=$1&SubcategoryID=$2 [L]
Can someone explain this to me. I'm trying to do that, with no success : I have www.mydomain.com/articles/show.php?id=xxxx (xxx are numbers) I have a script that makes a sitemap : I've changed the script to link to www.mydomain.com/article_category/article_name in the sitemap an no more to sho.php?id=xxx Now I don't know how to make the last step : opening the id=xxx article which corresponds to article_category/article_name. I've tried the above in the FAQ, but I'm a "bit" lost Thanks for your help I'd like to have www.mydomain.com
You have to know how to edit the script to spit out the URL with the article name in it, or manually add it in every single link, if the links are on static pages.
Thanks, I'm not sure I understand very well : Initially my sitemap file had links "show.php?id=xxxx" I've changed the script so that links in the sitemap are now "article_category/article_name.htm" (article_category and article_name are the infos related to id=xxx in the database) My problem is that when I mod rewrite, I have to make something so that the server knows that id=xxx coressponds to the database record with article_category and article_name Sorry, but it's really not my core competencies...
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)/([^.]+)\.htm$ show.php?id=$1 [L] If the URL is domain.com/id/name.htm with script URL as show.php?id=xxxx
thank for the tips nintendo. i am simply learning how to mod_rewrite using the help on the thread. unfortunately, i am getting errors. i am trying to mod-rewrite the search results page of the digitalpoint google api search software. i have this mod setup on my .htaccess on my root domain. Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase /search RewriteRule ^search/(.*)\.html$ search/search.php?q=$1 but i can only attain this. http://example.com/search/search.php/searchkeyword and i looks quite ok. but what i really want is to rewrite like this. http://example.com/searchfolder/searchkeyword/ can anyone help me out on this? thank you in advance!