ReWriteRule Questions

  1. Let’s take a simple example. I have a site where I want to keep the underlying structure hidden. It seems to me this is one of the big benefits to doing this if you have a public site. For a simple menu, am I better off giving each menu a different ReWrite or would it be better to use a two argument pass where the first indicates that it is a menu and the second indicates which menu item was pressed, like /menu/aboutus/ or /menu/contactus/ as opposed to /aboutus/ & /contactus/ with different rules? The individual rule is better for semantic reasons but it creates 5 rules (# of menu items) instead of 1.

  2. Does the structure and naming of the ReWrite have any effect on SEO?

  3. I use sebdirectories to hold pages. I would like to redirect anyone who types one of those names in a URL to the main page, so if they type http://mysite.com/dir1/ it will take them to the root page. I did that and it works fine, but if I try to redirect the menu calls to those subdirectories they will be redirected also.

Since I am using redirection anyhow and therefore the subdirectory names are not being exposed, am I just being too paranoid?

Sorry, it made sense to me. :slight_smile:

If my intention is to use ReWrites when I click a menu selection, it has to go to a page. So there needs to be a ReWrite rule for that page, correct? Otherwise I just send it to a directory with an index file and I don’t want to expose the directories.

So if I have multiple menu selections, there would be one rule for each menu selection to redirect to the appropriate page. Is that not true? So my question was one more of practicality vs semantics I suppose. I think it would look better if I wrote 5 rules, each with it’s own succinct url, rather than one rule with two arguments, the first being the fact that it is a menu call and the second being the menu name.

#3 was really looking for a way to control any browser request directly to a directory (someone typed in a URL) to be redirected. I don’t want anyone calling directory names except me on the server side and I will call them from the ReWrites. The reason I asked if I was just being paranoid is I don’t fully understand the world of the hackers and I would like to offer as much protection as possible. It seemed to me like that was a good level of protection. Again, maybe a question of inexperience which is why I thought I would ask.

Thanks

I don’t follow…what you are trying to explain here, why does the main menu need a different location or rewrite rule? I personally have just one rule, I send every path that does not point to a real file or folder to a single point (index.php). It then parses the path and delivers the correct content based on that path.

  1. Does the structure and naming of the ReWrite have any effect on SEO?
    Nope. Rewriting URLs is for humans not computers.

Since I am using redirection anyhow and therefore the subdirectory names are not being exposed, am I just being too paranoid?
Yes.

Gotcha, then I am barking up the wrong tree. Thanks so much for the time and the input. It helps tremendously.

Well I can tell you hiding the directory structure really won’t achieve anything. Not what you are thinking as it where. You are just putting an alternative path to the same location. But I never heard of any attack that is depended on the file structure of a site (unless we are talking about an automated system but those target brand name stuff like Wordpress).