tags:

views:

66

answers:

4

Hello, i need in naming like this:

site.com/about
site.com/contacts

Could i do it without .htaccess?

A: 

If you mean "Can I configure my webserver to parse /about and /contacts as PHP without using an .htaccess file", then no. Without further configuration (i.e. a local htaccess, or the global configuration files), Apache will not pass them through the PHP handler. You also won't be able to setup these URLs are redirects (internal or otherwise) without configuration (again via htaccess).

Adam Wright
A: 

that is rewriting google search

similar to:

Options +FollowSymLinks
RewriteEngine on
Rewriterule ^about /menu/about.html
Rewriterule ^contacts /menu/contacts.html
andres descalzo
While that's correct, he did ask if he could do it *without* .htaccess
mabwi
Those Apache configuration statements could be placed in the main Apache configuration instead of a per-directory configuration file (which is what .htaccess is).
David Dorward
you could throw that in the apache confs, which technically wouldn't be .htaccess.
mkoga
sorry to all, I understood "with" instead than "without"
andres descalzo
+8  A: 

If you want a very simple implementation then you could structure your folders to allow you to do something like:

site.com/about/ - which will go to /about/index.php
site.com/contacts/ - which will go to /contacts/index.php

But obviously there's no room for any dynamic URLs, for that you would need a .htaccess implementation. They're very simple to do.

Michael Waterfall
A: 

You could do it without a .htaccess file if you had access to the apache config files that define your site. However, if you can't use .htaccess files, you likely don't have access to the apache configs either. Might be wroth asking your host / sysadmin.

You might also be able to do it through the 404 handler if your host lets you have access to that.

Mark F