Safe Alternative To mod_rewrite - mod-rewrite

Hi guys just want to ask this after hours of mod_rewrite frustration and reading tons of
questions about it on stackoverflow because i tried everything and it didn't work with me. I don't know why, but i had enough so i searched about alternative and am asking here today for opinions. I came up with the following method.method
First assume I have this URL
http://www.domain.com/articles/6
and I have a articles.php page that will take the ID from this URL and pull the article
content from the database (mod_rewrite fails in here), so this is a little solution:
$article_id=explode("/",$_SERVER["REQUEST_URI"]);
show_article($article_id[3]);
the show_article() function will simply take the id and query the database for the article content and I read that the server will not understand that articles is a php page so a little solution too
<FilesMatch "^articles$">
< ForceType application/x-httpd-php >
</FilesMatch>
so two questions :
1- will this solution affect indexing my website pages from search engines spiders ?
2- is this a good solution or mod_rewrite is better?
Note:am sorry if the question not will formatted am not good in formatting if you can make it look better i will appreciate it really sorry

Don't give up with mod_rewrite, it's a bit non-intuitive but VERY powerful and useful piece of software! You'll never get so clean solution in application regarding URL manipulation. To your question:
1) no, it'll not affect indexing. Both your solution and the one involving mod_rewrite are for web spiders transparent,
2) mod_rewrite is definitely better
I do recommend you to ask question regarding your problems with mod_rewrite not doing what you want. I'm pretty sure you'll sort it out with someone.

Related

passing session variable from without www to with www

Session variable is not passing between the urls without www and with www
I have implemented url rewriting in my website.
Example:
I want to pass Session["hashtable"] from http://domain.com/product.aspx page to http://www.domain.com/shoppingcart.aspx
Session is not passing between these urls,
tried a lot of settings in web.config adding httpcontext defaultname=.domain.com
still not working.
Any solution for this, great helpful for me.
Thanks in advance
Kumar
I've never done anything like this myself, but according to this question and answer, How can I share a session across multiple subdomains in ASP.NET?, you should be able to do this by adding this line to your web.config file:
<httpCookies domain=".usa.com"/>
Again, I haven't tried it. But it makes sense, I think.
I'm viewing your domain.com as being a "subdomain" of the same as www.domain.com. This isn't really true in a technical sense, but in a lot of cases I've seen it work that way anyway, so I'm hoping this will be one of those cases.
Edit:
I just came across this post, ASP.NET sharing session across multiple wildcard subdomains, which leads me to think this might not actually work, after all. Let me know if it doesn't and I'll delete this answer.
Edit 2:
Okay, I'm searching and finding tons and tons of people with this very problem. It sounds like it might just not be doable. That is, these people don't have any answers whatsoever. So it could just be that people who ask this are super unlucky, or it could be that it's just some little-known solution, or it could be that it's impossible. Thus, I'm adding in my comment from above here, and calling it a part of my "answer."
Just in the interest of good SEO practice for this site which, from the paths you provided, appears to be retail-related, you should probably just redirect all requests at any point to your www. domain, before you even set the session variables. If you can't do that, for instance if your www. root is not the same as your empty one (Which you should change anyway, for users' sakes), spin up another subdomain and point all requests to that. Then you'll have two domains at the same level, and the first solution I posted should handle that.

Crawlers/SEO Friendly/Mod Rewrite/It doesn't make any sense

So I am attached to this rather annoying project where a clients client is all nit picky about the little things and he's giving my guy hell who is gladly returning the favor by following the good old rule of shoving shi* down the chain of command.
Now my question. The application consists basically of 3 different mini projects. The backend interface for the administrator, backend interface for the client and the frontend for everyone.
I was specifically asked to apply MOD_REWRITE rules to make things SEO friendly. That was the ultimate aim, so this was basically an exercise in making things more search friendly rather than making the links aesthetically better looking.
So I worked on the frontend, which is basically the landing page for everyone. It looks beautiful, the links are at worst followed by one backslash.
My clients issue. He wants to know why the backend interfaces for the admin and user are still displaying those gigantic ugly links. And these are very very ugly links, I am talking three to four backslashes followed by various get sequences and what not, so you can probably understand the complexities behind MOD_REWRITING something such as this.
In the spur of the moment I said that I left it the way it was to make sure the backend interface wouldn't be sniffed up by any crawlers.
But I am not sure if that's necessarily true. Where do crawlers stop? When do they give up on trying to parse links? I know I can use a .robot file to specify rules. But, as indigenous creatures, what are their instincts?
I know this is more of a rant than anything and I am running a very high risk of having my first question rejected :| But hey, it feels good to have this off my chest.
Cheers!
Where do crawlers stop? When do they give up on trying to parse links?
Robots.txt does not work for all bots.
You can use basic authentication or limited access by IP to hide back-end, if no files are needed for front-end.
If not practicable, try to send 404 or 401 headers for back-end files. But this is just an idea, no guarantee.
But, as indigenous creatures, what are their instincts?
Hyperlinks, toolbars and browser-sided, pre-activated functions for malware-, spam- and fraud-warnings...

Extremely clever URL system (how to make advance SEO urls)

I am building an intensive web application and currently all my URLs at the moment are in page.php?action=string format. Don't worry, we have a fall back plan to change all pages quickly to the SEO URLs via a config file.
I want to know two things. What script is running this site:
http://lookbook.nu/ (also http://stackoverflow.com)
If you just look at it, hover over areas, crazy ajax calls, so many subdomain calls, so many clean URLs. What would be the best approach to do this - is this a RoR thing? All the URLs are so clean and structured. It really impressed me.
I am not wishing for a htaccess solution as I am using nginx.
StackOverflow actually runs on ASP.NET MVC, but you have URL rewriting built in Apache too if that's your thing. No clue about nginx, though.
Edit: A simple Google search revealed http://wiki.nginx.org/HttpRewriteModule so you're in luck!

Advise on SEO-friendly URL structures

My site is written in php and has urls like this:
http://mysite.com/index.php?m=apple&f=show&t=hello-world
I want to change it to SEO friendly url.but i don't know which one is better:
http://mysite.com/apple/hello-world
or
http://mysite.com/apple/hello-world.html
would you help me?
I would not include the .html. It doesn't help your users at all. In general, if it is good for users it is good for SEO.
Try to avoid extensions where possible, as they may change over time, and URIs should remain static. Think about old sites that use the .cgi extension, and then migrated to another system, such as PHP. Although HTML is likely to be around for a long time, it too may change.
See Cool URIs don't change for a good introduction.

Captcha failing, now what?

Installed a captcha on my blog, been good up until now.
There have recently been a bunch of legit-at-first-glance-but-actually-spam entries along with stuff like this:
message: IDevY7 sdbgztbczgpj
from: fmfwls
The IP changes per submission and they must be correctly filling in the captcha. Is my only option manual approval of comments?
The thing is all captchas can be beaten by bots now, even reCaptcha which is a really great solution (Google) Try reCaptcha, you might have better results with that then what you are using now. I found it kept most things out when I was using it, but stuff still did get through.
Other than that look at some other non-captcha spam fighting solutions. Have you looked into akismet? Its a great server side solution that looks at the content and attempts to identify it as spam. Perhaps if you combine the two you may catch the majority of it.
There are various other tricks you can try too. I'd definitely recommend checking out akismet though.
Which captcha system are you using? Has it been broken? Have you tried recaptcha?

Resources