Sorry Nintendo doesn't work?? Confused.... As mentioned before this below works but still takes the value after the '?' RedirectMatch 301 property_details/viewimage.php.* h tt p://www.costaandsierra.com/ [R=301,L]
In that code I don't see any ? or value so I'm not sure how that works, unless it moves it to the new URL because it's not in the code for the old URL. RedirectMatch 301 property_details/viewimage.php?imageID=([^.]+)&type=listing$ http://www.costaandsierra.com/ [R=301,L] I'm not sure if ([^.]+) works in RedirectMatch 301 stuff.
Hi Nintendo, I was just wondering if you can help me rewriting a URL. E.g. I get the following values from DB for the these variables: catID: 67 itemID: 21 catName: flowers itemName: rose I want to rewrite the URL http://www.site.com/detail.php?catID=67&itemID=21 to something like http://www.site.com/flowers/rose.html Please help
It just copes the information by using the .* Correct it causes a 500 Error! Could I add some code to the viewimage file that would redirect it in 301 style to the homepage?
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^flowers/([^.]+)/rose/([^.]+)\.html$ detail.php?catID=$1&itemID=$2 [L] Code (markup): http://www.site.com/flowers/###/rose/###.html And the script would need to be changed to tho new URLs.
Thanks for the quick response. By this: http://www.site.com/flowers/###/rose/###.html you mean http://www.site.com/flowers/67/rose/21.html ? I actually want it to be http://www.site.com/flowers/rose.html
Is this for just one URL, or a lot? If it's for more than one, you would have to have a .htaccess line for every single URL to have it that way with out the numbers. RewriteRule ^flowers/rose\.html$ detail.php?catID=67&itemID=21 [L] if there's only one URL.
Ah that will be pain since I have more than one URLs. phpLinkdirectory is acting that way so I thought it might be easy. http://www.web-designers-directory.org/phpLD/Internet_and_Web_Services/ See the above example have no parameters in the URL
I won't be able to do it that way. The database is setup with the spaces. The + symbol works inbetween them, but not -. Is there a way through mod_rewrite to rename that %20 to something and then change the long url to a static one? Thanks again!
Internet_and_Web_Services is the part that changes and would be in the non_mod_rewrite version URL, along with all the other category names!! Only the script can change the links.
Nintendo, Is there anything wrong with this code: Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^index2/17131.html$ /items/index2.php?item_id=17131 Code (markup): Original address: http://www.domain.com/items/index2.php?item_id=17131 That should redirect here: http://www.domain.com/items/index2/17131.html ...right?
Nintendo, you're the man. Thanks soooo much for all the help! I worked on my site for about 4 hours last night changing my scripts around to work with .htaccess and now, every page looks like a static .html or a directory. AWESOME! Re-crawled my site, and sent in a new sitemap to google. Looking forward to having better coverage in G
Hi, I wanted to make subdomains without CPanel using .htaccess . What i want is to treat a subdomain like http://try.example.com] to http://www.example.com/try/ . I dont want to use CPanel in this. I tried a lot but no result. I read ur tutorial and tried that also. Here is the code that i tried: RewriteEngine on RewriteCond %{HTTP_HOST} ^(.*)\.example\.com$ RewriteCond %{HTTP_HOST} !^www\.example\.com$ RewriteRule (.*) http://www.example.com/%1$1 [P] Code (markup): I have also removed the $ sign after '.com' and tried but not working. My present Host is using CPanel.Could he possibly disabled the thing. Pls reply and help me out. Thanks and have a good day.
Can a htaccess interfere with proper functioning of subdomains? I have the following in my htaccess file but when I try to add a new subdomain in cpanel, it shows the content of mydomain.com everytime instead of subdomain.mydomain.com
If you don't get an answer to that here, make a new thread with that question in the title. I'm a n00bie at sub-domain stuff.
thanks Nintendo I could figure out the first 2 sections in the htaccess. but can you tell what does this stand for ? Thanks
RewriteRule ^index\.(html|php|htm)$ /cgi-bin/cgi.php?index.$1 [L] Extension can be html, php, or htm, though I don't see a (.*) spot for the stuff at $1 to show up, unless it's the html, php, and htm part. RewriteRule ^aa\-(.*)\/(.*)$ /cgi-bin/cgi.php?$1/$2?%{QUERY_STRING} [L] I'm not sure about the %{QUERY_STRING} stuff. I've never had it in a RewriteRule line.
actually, I was going to add sub-domain to an existing site and I found this in its htaccess file. since it is an existing site with good rankings in google, I didn't want to mess up anything have deleted the subdomain for the time-being. will see if someone can post here a reply or else will start a new thread. Thanks for your help, Nintendo