That's easy! Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^travel\-shop/([^.]+)\.html$ travel/travel-services.php?travel_service=$1 [L]
Nintendo, I've read through most of the posts and seen exact examples of what I'm trying to do but I still can't get it to work. I curently have some modrewrites in .htaccess so I know the module is working. . . Here is what I'm trying to do and along with some examples: Attempt #1: URL www. domain .com/modules.php?mod=Auto_Notify RewriteRule ^auto-notify\.html$ modules.php?mod=Auto_notify [L] Attempt #2: URL www. domain .com/modules.php?mod=Auto_Notify RewriteRule ^tools/(.*)\.html$ modules.php?mod=$1 [L] (trying to make: .com/tools/Auto_notify.html ) Attempt #3: www. domain . com/modules.php?mod=Extra_Pages&pg=partnerlinks RewriteRule ^resources/(.*)\.html$ modules?mod=Extra_Pages&pg=$1 [L] (trying to make: .com/resources/partnerlinks.html )
If you're trying all three of them at the same time, auto-notify should be auto\-notify and in order it should be Attemt 3, 2, 1. Post the complete .htaccess code.
Nintendo, The three examples were individual attempts to get it to work. . . Here's the current htaccess that includes attempt #3 as the first rule: Options +FollowSymLinks <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^tools/(.*)\.html$ modules.php?mod=$1 [L] RewriteRule ^page-([^\.]+)\.html$ index.php?page=out&id=$1 RewriteRule ^(([^-]+-([0-9]+))?.*)?ad([0-9]+)\.htm$ index.php?page=out&id=$4&set_region=$3 RewriteRule ^([^-]+)-r([0-9]+)\.html$ index.php?page=browse&type=region&cat=$2 RewriteRule ^([^-]+)-rs([0-9]+)\.html$ index.php?page=browse&type=region_select&cat=$2 RewriteRule ^([^-]+)-rsr([0-9]+)\.html$ index.php?page=browse&type=region_select&cat=$2&return=yes Code (markup):
I'm not sure about the RewriteRule ^(([^-]+)\-([0-9]+))?.*)?ad([0-9]+)\.htm$ index.php?page=out&id=$4&set_region=$3 [L] that looks messed up. And it looks like you changed the URL to add something in it that's not in the original URL. Hince starting with $2 instead of $1, or $3 and $4. <IfModule mod_rewrite.c> Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^tools/(.*)\.html$ modules.php?mod=$1 [L] RewriteRule ^page\-([^\.]+)\.html$ index.php?page=out&id=$1 [L] RewriteRule ^(([^-]+)\-([0-9]+))?.*)?ad([0-9]+)\.htm$ index.php?page=out&id=$4&set_region=$3 [L] RewriteRule ^([^-]+)\-rsr([0-9]+)\.html$ index.php?page=browse&type=region_select&cat=$2&return=yes [L] RewriteRule ^([^-]+)\-rs([0-9]+)\.html$ index.php?page=browse&type=region_select&cat=$2 [L] RewriteRule ^([^-]+)\-r([0-9]+)\.html$ index.php?page=browse&type=region&cat=$2 [L]
All the rules execpt for the first one are working. . . . . . which is why its so frustrating. The changes I want to make seem relatively simple but for some reason it's not -jay
If RewriteRule ^tools/(.*)\.html$ modules.php?mod=$1 [L] doesn't work, but RewriteRule ^page\-([^\.]+)\.html$ index.php?page=out&id=$1 [L] does, try RewriteRule ^tools/([^.]+)\.html$ modules.php?mod=$1 [L] (A \ doesn't need to be in ([^.]+) )
I made the changes and it does not work - see below. Question. . this is a test site in a directory off of a production domain i.e., domain. com/test-site/ . I copied the .htaccess from the web root into /test-site/ and have been making the modifications there. I was operating under the assumption that the .htaccess in the lowest level directory took precedence (sp?) . Could this be causing the problem? Thanks! -jay Options +FollowSymLinks <IfModule mod_rewrite.c> RewriteEngine On # RewriteRule ^tools/([^.]+)\.html$ modules.php?mod=$1 [L] RewriteRule ^page-([^\.]+)\.html$ index.php?page=out&id=$1 RewriteRule ^category-19.html http://www.classifiedads.com/sports_equipment-19.html [R=permanent] #RewriteRule ^([^-]+)-([0-9]+)\.html$ index.php?page=browse&cat=$2 #RewriteRule ^([^-]+)-([0-9]+)_([0-9]+)\.html$ index.php?page=search&s_res=AND&cid=$2&off=$3 Code (markup):
It's missing RewriteBase / and I never need <IfModule mod_rewrite.c> I usually use domain.com/.htaccess. I'm not sure exactly what it does when there are both root and directory ones at the same time.
I need 301 redirect, implimented with .htaccess file. I have lot of files with space in their name. Example - "search engine optimization.htm" need to redirect to "search-engine-optimization.php". Can you tell me how to do it, please?
This is alternate... Actually I am getting lot of traffic on pages with space in their name, so i can't change their name and then redirect it. Also, if i replace space with _ or - then it simply means...change in file name...which could be with .php also
I don't think it'll work! Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+) ([^.]+) ([^.]+).html$ http://www.domain.com/$1-$2-$3.htm [R=301,L] RewriteRule ^([^.]+) ([^.]+).html$ http://www.domain.com/$1-$2.htm [R=301,L]
Okay a question. I have mod rewrote www.mysite.com/blah/blah.php?id=69 to www.mysite.com/69 - no problem but I have seen examples where the www.mysite.com/69 has the same PR as www.mysite.com - how have these people done this? If you do a link www.mysite.com/69 it has the exact same links as link www.mysite.com - so somewhere Google is picking up that /69 is the same as www.mysite.com Any ideas?
Nintendo, So I've got this right my current .htaccess file says RewriteEngine on RewriteBase / RewriteRule ^([0-9]+) travel-shop/carrentals.php?id=$1 Should it be as above but after travel-shop/carrentals.php?id=$1 [R=301,L] What impact would the [R=301,L] have?
It redirects to the new URL. I've tred it once and on the next PR update the new URL had the same PR as the old URL had.
I've never figured out how to Optimize mySQL. For Apache I've never had to do any more than those number settings. RewriteEngine on RewriteBase / RewriteRule ^([0-9]+)$ http://www.domain.com/travel-shop/carrentals.php?id=$1 [R=301,L] or RewriteRule ^travel-shop/carrentals.php?id=([0-9]+)$ http://www.domain.com/$1 [R=301,L] RewriteRule ^OLD-URL-PATH, no domain$ NEW COMPLETE URL $1 [R=301,L]
I have changed the server and converted the static site into .php site. Also now i am not using www in doamin. While doing this I lost PR. It was PR6, now it is PR0. What to do to gain back lost PR???