I have successfully implented the code on my entire php + MySql Database driven site it has approx 75000 pages my .htaccess code is around 30 lines. But the main issue is that when I open more than 4 to 5 page at same time my server load is raising more than 7 to 8 and some time my entire server get stuck up I don't know how to tackle with that cna you help on this? Current apache settings which I have <IfModule prefork.c> StartServers 110 MinSpareServers 75 MaxSpareServers 125 MaxClients 900 ServerLimit 900 MaxRequestsPerChild 0 </IfModule> other settings ServerLimit 1024 KeepAlive On MaxKeepAliveRequests 50 KeepAliveTimeout 1 Please help
If i have a site: site.com and i want to redirect to index.php sending the complete url writen? If user typw site.com/anything/else/another/file.php or whatever i get the full path that the user try to get, how can this be done?
How would I rewrite a sub-domain like this. I want to redirect secure.nixism.com to my.nixism.com. How would I do that?
First time using mod_rewrite and would really appreciate some help. I am using: Options +FollowSymLinks RewriteEngine on RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)\.html$ searchresult.php?cat_id=$2[L] RewriteRule ^madeupword/([a-zA-Z0-9_-]+)/([0-9]+)\.html$ article.php?art_id=$2[L] Code (markup): This make the links work like this: [url]http://www.mysite.com/Pasta-articles/24.html[/url] [url]http://www.mysite.com/madeupword/How-to-pasta/581.html[/url] Code (markup): This seems to work fine but the problem is, my url's are generated dynamically and for me to change them to static links there are spaces between the words. So the static link looks like this: [url]http://www.mysite.com/Pasta%20articles/24.html[/url] Code (markup): Instead of this: [url]http://www.mysite.com/Pasta-articles/24.html[/url] Code (markup): How can I change this code to replace a space(%20) with a dash(-)?
The script has to do the change, like a search and replace there. The script makes the links. mod_rewrite only makes the URLs work.
Thanks Nintendo and vasyl Yes I hade to change the link in my site's script. Lucky it's all templates so you only need to change it in a few places. This is how I created the link for one of the pages: Next I'll try out your query string examples. It's a great tutorial thank you. What I would really like is a even cleaner url like what WBseo does.: www.yoursite.com/general-chat/ (category) and www.yoursite.com/general-chat/hello-people/(post inside category)
I want to transfer from old domain to new domain with 301 redirect but dont know much about .htaccess codes so plz help me and tell me the way and code that i dont lose users and search engine traffic. I want to transfer many section (folders) and files to new domain but wanna use index and some section (folder) remain active on old domain so plz tell me 1: How to redirect folders and php and html file to new domain ? plz remember that i will upload all files and folders on new domain with same structure, names and extension as on old domain. 2: What code to put in .htaccess to remain active some section folders and files with php and html extension on old domain ? 3: If i have 100+ php and html files in root and wanna 301 redirect all to new domain but remain index file on odl domain with same name and extension and structure then what code to use to redirect all files to new domain but index remain active on old domain ?
I have seen it load down a server by as much as 30%, but that was in an extreme (and dumb) case. We (I won't say where) had thousands of rewrite conditions and rules in our .htaccess file. Once we made generalized rules and trimmed the number of rules to a reasonable amount, the server load dropped to nill.
How would you go about mod_rewriting OUT a directory? Is it possible? Can I rewrite this with a rule: mysite.com/SUPER/ROCKIN/COOL/AWESOME/whatever.html to this: mysite.com/COOL/AWESOME/whatever.html (REWRITE OUT THE SUPER AND ROCKIN WITHOUT REMOVING THE DIRECTORIES) I feel like this is possible, maybe not...I don't know. I would appreciate any help. Also, if this is possible, anyone have the general rules I would write/follow to make this happen. SOME ADDITIONAL INFO: ASSUME THAT "ROCKIN" AND "SUPER" ARE DIRECTORIES THAT CANNOT BE MOVED/DLETED/ETC....
old-domain.com/.htaccess Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase /mb/ RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L] domain.com/.htaccess Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^COOL/AWESOME/([^.]+)\.html$ SUPER/ROCKIN/COOL/AWESOME/$1.html [L]
thta is great, thanks a lot...It's funny, I could not find one thing on the internet that had insturctions or the code written out to follow...I appreciate it, very nice.
If you want to redirect them all seperatly, you can do it like this in your old domain's .htaccess file: redirect 301 /abc.html http://www.newdomain.com/abc.html redirect 301 /def.html http://www.newdomain.com/def.html redirect 301 /ghi.html http://www.newdomain.com/ghi.html Code (markup):
First of all, thanks heaps for this tutorial I really appreciate it and it's already helped me lots. If anyone can help me out in writing a rule for this kind of url I'd be very gratefull.
Hello Nintendo Thank you very much for taking the time to help. Latest Articles: (/articles/latest-articles) http://www.mysite.com/searchresult.php?sort_id=3&sbtype=1&inname=-1,-1&exname=-1,-1&all=1 Top Rated Articles: (/articles/top-articles) http://www.mysite.com/searchresult.php?sort_id=5&sbtype=1&inname=-1,-1&exname=-1,-1 Looks like a war-zone in there doesn't it?