Search Engine Watch
SEO News

 

  #21  
Old 06-22-2005
fazman fazman is offline
Member
 
Join Date: Jun 2005
Location: Aus
Posts: 5
fazman is on a distinguished road
Hi Mike, I actually got to chat with my host and he got it all fixed up for me.

He commented out the ones that werent working so we could see the differance.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /order/
#RewriteCond %{REQUEST_URI} ^/order.*
#RewriteRule ^order/([^/]+)/?$ index.php?order=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^order/([A-Za-z0-9]*)$ /order/index.php?order=$1 [QSA]

</IfModule>

Its all working smoothly now.

Thanx again for your help, and hopefully this will help someone else in the future.

faz
Reply With Quote
  #22  
Old 06-22-2005
seomike seomike is offline
M·d_Rewrite Guru
 
Join Date: Jun 2004
Location: Dallas, Texas but forever a Floridian!
Posts: 627
seomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to behold
Instead of this rule
RewriteRule ^order/([A-Za-z0-9]*)$ /order/index.php?order=$1 [QSA]


I would suggest using this one it will be a faster and less strain on the server. it will also pick up the url with or with out the trailing /

RewriteRule ^order/([^/]+)/?$ /order/index.php?order=$1 [QSA,L]


When you do a /([A-Za-z0-9]*)$ you are looking for alpha numeric 0 to infinite times without a trailing / this is fine but if anyone links to the page with a trailing / it won't get picked up by the mod.

Reply With Quote
  #23  
Old 12-09-2005
perfectlover
 
Posts: n/a
Hi,
Based on your tutorial, I have modified code for my site. I intend to change from
http://www.mydomain.com/cgi-bin/book...sin=0815332181

to

http://www.mydomain.com/cgi-bin/book...0815332181.htm

my code is as follows:
RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} ^asin\=([^&]+)$
RewriteRule ^$ /displayitem/%1.html [R=301,L]


this code did not do anything. Please help me out.

Thank you,

Stefan
Reply With Quote
  #24  
Old 12-09-2005
seomike seomike is offline
M·d_Rewrite Guru
 
Join Date: Jun 2004
Location: Dallas, Texas but forever a Floridian!
Posts: 627
seomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to behold
You need to change your code to output the static url. Then use a rewrite rule to rewrite static -> dyamic on the server.

http://www.mydomain.com/cgi-bin/book...0815332181.htm ->
http://www.mydomain.com/cgi-bin/book...sin=0815332181


Code:
RewriteEngine On
RewriteBase /

RewriteRule ^cgi-bin/books/displayitem/([^/]+)\.htm$ cgi-bin/books/displayitem.cgi?asin=$1 [L]
Just add this to the .htaccess on the root of your website.
Reply With Quote
  #25  
Old 12-10-2005
newline100
 
Posts: n/a
might have just answered this but............

Hi,

I appreciate your help on these boards but I am new to this stuff & having some problems. Let me start with the basics:

I have successfully used the mod_rewrite by changing:

http://www.mysite.com/mydirectory/postlist.php?Cat=0&Board=myfile
to
http://www.mysite.com/mydirectory/myfile.htm
by using the following .htaccess code:

RewriteEngine on
RewriteBase /mydirectory/
RewriteRule ^myfile\.htm$ postlist.php?Cat=0&Board=myfile [T=application/x-httpd-php]

Here is my problem, I have to physically type in the static address to make sure this code works. On my webpage, when I run my mouse pointer over the target link, the dynamic link shows up on the bottom left hand corner of the browser. Furthermore, when I click the link, it still defaults to the old dynamic url.
Is there extra code that will make the static URL show up (redirect) in the browser window? Also, is there a way to make the new (static) URL show up on the bottom left hand corner of my browser before it is clicked? Will that even matter to the search engine spiders?

If you could please explain all of this very carefully, I would appreciate it. As I stated, I'm new to all of this.
Reply With Quote
  #26  
Old 12-12-2005
seomike seomike is offline
M·d_Rewrite Guru
 
Join Date: Jun 2004
Location: Dallas, Texas but forever a Floridian!
Posts: 627
seomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to behold
Mod rewrite doesn't rewrite your links. It rewrites urls that your links output back to the dynamic form on the server. see this for more info on mod rewrite's can and cannot's.

So you have to open your page code and change how it outputs your <a href> Once you do that then you make a rewrite rule to rewrite the static to dynamic
Reply With Quote
  #27  
Old 12-28-2005
neo4242002
 
Posts: n/a
Hello...

interesting thread... I have something to do.. when I maintenance my site I put under construction page
something like mydommain.com/index.htm

and i want to redirect al traffics come to this site to that page..

something like

if some one try to visit mydommain.com/see.php or mydommain.com/stuffs/index.htm or what every the URL they all forward to my Under construction page.

Dose anyone can help me please?
Reply With Quote
  #28  
Old 02-06-2006
Cascade
 
Posts: n/a
Help with fancy URL please

Hi all,

Just found the forums. They are great, I have a lot of reading to do

I currently have this url:

http://www.domain/archives/category/ely-history/

But ideally I would like to do this:

http://www.domain.com/ely-history/

Can I do this?

Many thanks
Reply With Quote
  #29  
Old 02-06-2006
grnidone grnidone is offline
Righteous Babe.
 
Join Date: Aug 2004
Location: Carrollton, TX
Posts: 138
grnidone is just really nicegrnidone is just really nicegrnidone is just really nicegrnidone is just really nice
Can you walk me through this line?

Quote:
RewriteRule ^$ /catalog/%1-%2.html [R=301,L]
^ -- beginning
$ -- ending
/catalog/ -- anything with the letters 'catalog' in that order only
%1 -- variable one
%2 -- variable two
.html -- put period and letters 'html' in that order only

And then... I need help. Does the R stand for 'Redirect' and 301 that it is a 301 redirect? What is 'L'? And tell me what the [ ] at the end is called so I can look it up and learn more. (Extension?)

Thanks.

Last edited by grnidone : 02-06-2006 at 04:04 PM.
Reply With Quote
  #30  
Old 02-06-2006
seomike seomike is offline
M·d_Rewrite Guru
 
Join Date: Jun 2004
Location: Dallas, Texas but forever a Floridian!
Posts: 627
seomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to behold
[] is a flag holder

R, by default is a 302 redirect
R=301, tells the server to issue a 301 header instead of 302
L, mean this is the last rule.
F, Forbidden
QSA, query string append if there is any query string on the url add it to the rewrite rules output.

These are the main ones you'll use I have a list of what all the flags mean here

http://www.webforgers.net/mod-rewrit...ite-syntax.php
Reply With Quote
  #31  
Old 02-24-2006
finch8243
 
Posts: n/a
I need a tip

seomike or anyone else -- here's a tough one I've been struggling with:

One of my categories is music -- you go to the music page and there are a ton of items. I currently have my mod rewrite changing this:
www.mysite.com/shop/music

to this:
www.mysite.com/index.php?category=music

so my mod rewrite language is something like:
RewriteRule ^shop/music$ index.php?category=music [NC]

Easy enough. But on the music category page, I want to have some "sort by" links -- sort all music by price, sort by bestsellers, etc. I was thinking of having the links as follows:

www.mysite.com/shop/music?sortby=price
www.mysite.com/shop/music?sortby=bestsellers
etc etc

I'd like it to load a page:
http://www.mysite.com/index.php?cate...c&sortby=price
http://www.mysite.com/index.php?cate...by=bestsellers

So what would the mod rewrite language be? I'm having trouble telling it to "look after the question mark in the requested URI and add the following stuff on to the underlying page".

Any way to do this? Incidentally, I'd like to avoid doing this:
www.mysite.com/shop/music/price
www.mysite.com/shop/music/bestsellers

I know how to do this already. Why do I want to avoid this? Because my analytics solution reads each of those as separate pages and I don't want it to do that.

Thoughts? Thanks for any help fellas.
Reply With Quote
  #32  
Old 02-25-2006
futureweb futureweb is offline
Newbie
 
Join Date: Feb 2006
Posts: 2
futureweb is on a distinguished road
Do I have this right ?

The Plan

from this:
mobiles.php?net=T-Mobile&make=Motorola&model=V3&id=9

to this:
/mobiles/T-Mobile/Motorola/V3-9.html


Code:
RewriteCond %{QUERY_STRING} ^net\=([^&]+)\&make\=([^&]+)\&model\=([^&]+)\&id\=([^&]+)$
RewriteRule ^$ /mobiles/%1/%2/%3-%4.html [R=301,L]
Thanks in advance.
Reply With Quote
  #33  
Old 02-25-2006
futureweb futureweb is offline
Newbie
 
Join Date: Feb 2006
Posts: 2
futureweb is on a distinguished road
here is what I have managed to figure out.

Code:
#start .htaccess code

RewriteEngine On
RewriteRule ^mobiles/(.*)/(.*)/(.*)-(.*).html$ mobiles.php?net=$1&make=$2&model=$3&id=$4 [L]
RewriteRule ^makes/(.*)/index.html$ make.php?make=$1 [L]
RewriteRule ^networks/(.*)/index.html$ network.php?net=$1 [L]
lets take the first one as an example
Code:
RewriteRule ^mobiles/(.*)/(.*)/(.*)-(.*).html$ mobiles.php?net=$1&make=$2&model=$3&id=$4 [L]
the dynamic url: mobiles.php?net=Orange&make=motorola&model=V3&ID=4

^mobiles/ = the name of the script mobiles.php
/(.*) = catches the name of the dir so net=motorola will be motorola and then the next /(.*) will pick up make=Orange making orange and /(.*) will pick up model=V3 as V3 and -(.*) will pick up the ID=4 as -4 .html is the file ext

so my url can be
mobiles/Orange/motorola/V3-4.html

and the above rule will translate it into:
mobiles.php?net=Orange&make=motorola&model=V3&ID=4

seems to work well have I done it right is there a more efficent way of doing it ?
Reply With Quote
  #34  
Old 02-27-2006
jphilapy jphilapy is offline
Newbie
 
Join Date: Feb 2006
Posts: 3
jphilapy is on a distinguished road
server rewrites issue

Hi,

In the past we used mod_rewrite to rewrite the urls of all the html pages so they pointed to a php page. Now when google access our server to check the sitemap page they gave us it says we are returning a 200 when we should be returning a 404. I'm not sure if they are testing the Sitemap page only and coming to their conclusion or if they are checking for an actual bogus page on our server and getting a 200 error when they expect a 404.

If they are only checking their assigned error then I know a workaround. That is, have the server rewrite check for their page name, and then dont process it in rewrite. If they are checking for a bogus page, than i don't know yet how to resolve this. If this is the case than I would appreciate some suggestions.

Thanks,
Jeff
Reply With Quote
  #35  
Old 02-27-2006
seomike seomike is offline
M·d_Rewrite Guru
 
Join Date: Jun 2004
Location: Dallas, Texas but forever a Floridian!
Posts: 627
seomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to behold
I don't think I understand the question fully. Are you having an issue of Google still crawling old versions of the url because the site map still links to it?

or there was an old site map and it's not there anymore but when called the mod rewrite picks it up and sends 200 ok response and you want to kill that?
Reply With Quote
  #36  
Old 02-28-2006
jphilapy jphilapy is offline
Newbie
 
Join Date: Feb 2006
Posts: 3
jphilapy is on a distinguished road
Quote:
Originally Posted by seomike
I don't think I understand the question fully. Are you having an issue of Google still crawling old versions of the url because the site map still links to it?

or there was an old site map and it's not there anymore but when called the mod rewrite picks it up and sends 200 ok response and you want to kill that?
The issue was I am trying to start using the sitemap service that google offers, however the returned this error message when I submitted the site:

=====
We've detected that your 404 (file not found) error page returns a
status of 200 (OK) in the header.
This configuration presents a security risk for site verification and
therefore, we can't verify your site. If your web server is
configured to return a status of 200 in the header of 404 pages, and
we enabled you to verify your site with this configuration, others
would be able to take advantage of this and verify your site as well.
This would allow others to see your site statistics. To ensure that
no one can take advantage of this configuration to view statistics to
sites they don't own, we only verify sites that return a status of
404 in the header of 404 pages.
=====

The error message is confusing as I am not sure how they get a 404 error. I am using server rewrites, however when they visit the page that they gave us they send us back that error message. Sorry it doesnt make any sense to me.

However I did solve the problem, I disabled the server rewrites long enough to resubmit the site to the google service. They approved it and then I renabled the server rewrite.

My bottom line question is, how are they coming to the above conclusion? In my situation what would I be doing for them to conclude the above?

Jeff
Reply With Quote
  #37  
Old 02-28-2006
seomike seomike is offline
M·d_Rewrite Guru
 
Join Date: Jun 2004
Location: Dallas, Texas but forever a Floridian!
Posts: 627
seomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to beholdseomike is a splendid one to behold
You got me. lol I've never heard anything like this
Reply With Quote
  #38  
Old 02-28-2006
BradBristol BradBristol is offline
Has-Been "SEO Expert"
 
Join Date: Jan 2006
Posts: 107
BradBristol will become famous soon enoughBradBristol will become famous soon enough
Are you using a custom 404 page?
Reply With Quote
  #39  
Old 02-28-2006
jphilapy jphilapy is offline
Newbie
 
Join Date: Feb 2006
Posts: 3
jphilapy is on a distinguished road
Quote:
Originally Posted by BradBristol
Are you using a custom 404 page?
nope. The only thing I can think of is I am rewriting all html pages to an index.php page. If you try to access a page on the server that does not exist then you are redirected to another page via server rewrites. So in short a page not on the server always appears to be there even when it isn't. Even then I don't see what that has to do with the issue they are pointing out. According to them the page is returning a 200 in the header. So if it is and there is a page showing up on the server, what is the problem?

The fact is when I remove the server rewrites from the htaccess file, they have no problems.

Jeff
Reply With Quote
  #40  
Old 04-06-2006
jimgem
 
Posts: n/a
mod rewrite

I'm new at mod rewrite.
I know how to write a line in the htaccess file to make the link "search friendly" as long as the arguments after the "?" has this format: xxx=something&xxx2=something2, but how is it written when the arguments don't have the "=" sign. They are like this: ?xxx&xxx
Thanks for any suggestions.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 04:50 PM.