Forum Moderators: phranque
However, in order for the static URL to "show" you have to publish it. That is, your pages must output the static URLs so that users can click them and 'bots can follow them. When the resulting requests for static URLs arrive at your server, mod_rewrite will change them into the form needed to invoke your article.php script and generate the requested page.
If it's not clear, mod_rewrite modifies incoming URL requests, and has no effect on the content output by your server. It works in the URL-to-filepath translation phase, and not in the content-handling phase.
Making just a few minor tweaks to what you've got, I'd start with:
RewriteRule ^Article/[^/]+/([0-9]+)/? /article.php?id=$1&act=$2 [L]
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
Thank you very much for your word. This are tested ideas.
I added in .htaccess what you have told me, and the links are site.net/Article/Tomato-Sauce/171
and it is opening with: site.net/Article/Tomato-Sauce/171/index.htm or index.php
This mean google will index. Using thsi rewrite
RewriteRule ^Article/[^/]+/([0-9]+)/? /article.php?id=$1&act=$2 [L]
In the past I got a white blank page without your idea.
Jim, I just few questions:
When I click on the link, I got in browser exactly this address:
site.net/Article/Tomato-Sauce/171
Could I redirect automatically to open link like
site.net/Article/Tomato-Sauce/171/index.html?
Or How could I change the link to be:
site.net/?Tomato-Sauce&id=171
Dan
If this is the case, then you need to look at all .htaccess files and the httpd.conf file in that path, as well as your actual scripts, and find out why that redirect is happening. You cannot fix the redirect by redirecting again, or you will just get a redirect-loop, and the visitor will never see anything but an error page. So, the problem is in your server configuration (.htaccess or httpd.conf) scripts or in your php page-generation scripts.
Once you have fixed the root cause of the problem, you can then 'fix' search engine listings by using an additional redirect. So post whatever you find that is redirecting requests and appending index.xyz to the requested URL.
Jim