RewriteRule ^search/([^.]+)/([^.]+)\.html$ search.html?author=&category=&keyword=&number=&x=$1&y=$2 [L,NS,NC,QSA] if only X and y ever have anything domain.com/search/XXXXX/YYYYY.html RewriteRule ^search/([^.]+)/([^.]+)/([^.]+)/([^.]+)/([^.]+)/([^.]+)\.html$ search.html?author=$1&category=$2&keyword=$3&number=$4&x=$5&y=$6 [L,NS,NC,QSA] if all of them do. domain.com/search/AUTHOR/CATEGORY/KEYWORD/NUMBER/XXX/YYY.html
I am having a lot of trouble with this Rewrite. I have http://www.ilovehuatulco.com/huatulco/viewforum.php?f=1 that I am trying with the able2know script to cahnge to http://www.ilovehuatulco.com/huatulco/forum-1.html Ok I do have mod_rewrite on my server aftger a little test. My .htaccess is ............................................... RewriteEngine On RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?p=$1&highlight=$2 [L,NC] RewriteRule ^post-([0-9]*).* viewtopic.php?p=$1 [L,NC] RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC] RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?t=$1&highlight=$2 [L,NC] RewriteRule ^about([0-9]*).html&view=newest viewtopic.php?t=$1&view=newest [L,NC] RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC] RewriteRule ^about([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2 [L,NC] RewriteRule ^about([0-9]*).* viewtopic.php?t=$1 [L,NC] RewriteRule ^about([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC] RewriteRule ^mark-forum([0-9]*).html* viewforum.php?f=$1&mark=topics [L,NC] RewriteRule ^updates-topic([0-9]*).html* viewtopic.php?t=$1&watch=topic [L,NC] RewriteRule ^stop-updates-topic([0-9]*).html* viewtopic.php?t=$1&unwatch=topic [L,NC] RewriteRule ^forum-([0-9]*).html viewforum.php?f=$1 [L,NC] RewriteRule ^forum-([0-9]*).* viewforum.php?f=$1 [L,NC] RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC] RewriteRule ^ptopic([0-9]*).* viewtopic.php?t=$1&view=previous [L,NC] RewriteRule ^ntopic([0-9]*).* viewtopic.php?t=$1&view=next [L,NC] ........................................... I guess there are a million reasons this is not working, but any light would be great. Cheers Kevin
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^post\-([^.]+)\.html&highlight=([^.]+)$ viewtopic.php?p=$1&highlight=$2 [L,NC] RewriteRule ^post\-([^.]+)$ viewtopic.php?p=$1 [L,NC] RewriteRule ^view\-poll([^.]+)\-([^.]+)$ viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC] RewriteRule ^about([^.]+).html&highlight=([^.]+)$ viewtopic.php?t=$1&highlight=$2 [L,NC] RewriteRule ^about([^.]+).html&view=newest$ viewtopic.php?t=$1&view=newest [L,NC] RewriteRule ^about([^.]+)\-([^.]+)\-([^.]+)\-([^.]+)$ viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC] RewriteRule ^about([^.]+)\-([^.]+)$ viewtopic.php?t=$1&start=$2 [L,NC] RewriteRule ^about([^.]+)$ viewtopic.php?t=$1 [L,NC] RewriteRule ^about([^.]+)\.html$ viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC] RewriteRule ^mark\-forum([^.]+)\.html* viewforum.php?f=$1&mark=topics [L,NC] RewriteRule ^updates\-topic([^.]+)\.html*$ viewtopic.php?t=$1&watch=topic [L,NC] RewriteRule ^stop\-updates\-topic([^.]+)\.html*$ viewtopic.php?t=$1&unwatch=topic [L,NC] RewriteRule ^forum\-([^.]+)\.html$ viewforum.php?f=$1 [L,NC] RewriteRule ^forum\-([^.]+)$ viewforum.php?f=$1 [L,NC] RewriteRule ^topic\-([^.]+)\-([^.]+)\-([^.]+)$ viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC] RewriteRule ^ptopic([^.]+)$ viewtopic.php?t=$1&view=previous [L,NC] RewriteRule ^ntopic([^.]+)$ viewtopic.php?t=$1&view=next [L,NC] This is closer, but not correct 100%, becase for example RewriteRule ^post\-([^.]+)\.html&highlight=([^.]+) looks like you want the URL as domain.com/post-WHATEVER.html&highlight=WHATEVER
Hi, Thanks for the reply. I have to admit that I am out of my league here, but I want this to work so I will jump through any hoops I need. I did as you reccomended and now I get an internal server error "file not found' please see http://www.ilovehuatulco.com/huatulco/forum-1.html. The main script that it is trying to sepak to is 'includes/page_header.php' to which I added ... ................................................................. if ( !$userdata['session_logged_in'] ) { ob_start(); function replace_for_mod_rewrite(&$s) { $urlin = array( "'(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'", "'(?<!/)viewforum.php\?f=([0-9]*)&mark=topics'", "'(?<!/)viewtopic.php\?t=([0-9]*)&watch=topic*'", "'(?<!/)viewtopic.php\?t=([0-9]*)&unwatch=topic*'", "'(?<!/)viewtopic.php\?t=([0-9]*)&highlight=*'", "'(?<!/)viewforum.php\?f=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'", "'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'", "'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&vote=viewresult'", "'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)'", "'(?<!/)viewtopic.php&p=([0-9]*)'", "'(?<!/)viewtopic.php\?p=([0-9]*)'", ); $urlout = array( "topic-\\1-\\2-\\3.html", "mark-forum\\1.html", "updates-topic\\1.html", "stop-updates-topic\\1.html", "about\\1.html&highlight=\\2", "forum-\\1.html", "ptopic\\1.html", "ntopic\\1.html", "view-poll\\1-\\2-\\3.html", "about\\1-\\2-\\3-\\4.html", "about\\1.html", "about\\1-\\2.html", "about\\1.html", "post-\\1.html", "post-\\1.html", ); $s = preg_replace($urlin, $urlout, $s); return $s; } } ................................................................. Just to give you a little background. Cheers Kevin
I stink at php. You might want to try hireing some one to get it all working. RewriteBase / to RewriteBase /huatulco/ And with the .htaccess file at domain.com/.htaccess
Oh my god it worked with just moving it to /huatulco/ woweee. I am so thankful to you for spending the time to help out. Cheers If you ever need a hotel in Huatulco just tell me. Kevin
How would I go about rewriting site.com/directory/category.php?cat_id=123 to site.com/directory/category-123/ ? I have tried doing this, but when I use the following code, it takes an extra ten seconds or so for the server to send the page. If I rewrite it to .../category-123.html , it sends it instantly. The code I was trying is below: Options +Indexes Options +FollowSymlinks RewriteEngine On RewriteBase /directory/ RewriteRule ^category\-([0-9]*)/$ category.php?cat_id=$1 [L] Code (markup): And the .htaccess file is in the /directory/ directory. Any suggestions? My site is hosted at HostGator if that matters. Thanks,
Options +Indexes Options +FollowSymlinks RewriteEngine On RewriteBase /directory/ RewriteRule ^category\-([^.]+)/$ category.php?cat_id=$1 [L] Or try it at domain.com/.htaccess Options +Indexes Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteRule ^directory/category\-([^.]+)/$ directory/category.php?cat_id=$1 [L]
Nintendo, I just discovered that the dynamic calendar on one of my sites had been indexed out to the year 3050 (empty pages for all months, days, weeks, event detail) in all total about 80k pages. The Google jagger update does not like this AT ALL. I've removed the calendar but the pages are still in Google's index. The site is mambo and the calendar is call "Events Calendar" How would I build a modrewrite to issue a 404 anytime one of the calendar pages are referenced? The calendar URLs have the format of: www.wakulla.com/option,com_events/task,view_cat/catid,175/year,2005/month,09/day,29/Itemid,1/ The calendar component name called "com_events." Any advice on how I could filter on and issue a 404 for these URLs?: "www.wakulla.com/option,com_events" or "www.wakulla.com/index.php?option=com_events" Thanks if you can help. -jay
Thanks for the help, however, when I use the above code, the page takes at least 10-20 extra seconds to load. Any suggestions? The server currently works fine for url's written as .../directory/category-123.html Thank you,
What did the .htaccess file look like when it was fast going to .../category-123.html Was .html instead of / the only change? :::Any advice on how I could filter on and issue a 404 for these URLs?: You might want to make a new thread for that. I'm not sure if robots.txt could do anything like that.
sorry. . . All URL requests would be 404'd . I've deleted the calendar pages. . and the mambo component manager has a bad habit of doing a 200 status code and then a 302 redirect to a page that says "this page does not exist" . So I want apache to give everyone a 404 . -jay
Thank you for your patience. I'm not asking the right question or not asking the right question correctly Would this rewrite rule: RewriteRule ^option\,com_events [F] Code (markup): Generate a 404 error for the following URL: http://www.wakulla.com/option,com_events/task,view_cat/catid,175/year,2005/month,09/day,29/Itemid,1/ Code (markup):
The current line in the .htaccess file is this: RewriteRule ^category\-([0-9]*)\.html$ category.php?t=$1 [L,NC] Code (markup): I know that the following also works: RewriteRule ^category-([0-9]*).html category.php?t=$1 [L,NC] Code (markup):