Forum Moderators: phranque

Message Too Old, No Replies

URL structure in site running on Apache.

         

born2run

4:59 am on Mar 17, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi I have "domain.com/word1" as a valid page with content.

Can I now have "domain.com/word1/word2" as another valid page? Notice that word1 is common in both urls..

Kindly advise.. Thanks!

lucy24

5:42 am on Mar 17, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sure. Absolutely no problem whatsoever. Just make sure that the rule that rewrites from
/word1
to
/word1.php
(or whatever the real filename is)
is appropriately anchored, so you don't get the wrong rewrite. It's also best to put the RewriteRules for
/word1/word2
before the ones for
/word1
alone.

Whether you really want to do this is a whole nother question. But it's a human-usability question, not an Apache question. For many years I had a whole package of
/directory/word1/more-stuff
/directory/word1.html
/directory/word2/more-stuff
/directory/word2.html
and so on. I changed it because it made no sense for humans. Including, ahem, me ;)

tangor

5:45 am on Mar 17, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can do anything you like. The question, which I suspect you are asking, is SHOULD I?

Depends on the word (as in keyword stuffing and might get a hit). Try it. See if it works. But do know that once you do you can never take it back as the search engines NEVER forget a url they have met.

Your hierarchy needs to make sense to both you, the user, and the search engines. Keep that in mind.

tangor

5:49 am on Mar 17, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



lucy24, where is the query rewrites coming from? Did I not get the memo?

lucy24

2:27 am on Mar 18, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is possible on paper to have physical files on your server called "blahblah" without extension, and then use handlers or content negotiation to get everything processed appropriately. But it is vastly more likely that the URL example.com/blahblah represents the physical file example.com/blahblah.php -- or, for that matter, example.com/index.php?page=blahblah.

tangor

3:03 am on Mar 18, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks!