开发者

Apache configuration question about uri

开发者 https://www.devze.com 2023-02-10 00:57 出处:网络
I have a question but I\'m almost positive I\'m just missing the vocabulary on it. Basically, what configuration in apache ignores everything past a uri?

I have a question but I'm almost positive I'm just missing the vocabulary on it.

Basically, what configuration in apache ignores everything past a uri?

For example:

www.mydomain.com/My-Page

www.mydomain.com/This-Is-Some-Page/somepage.html

I basically want to write开发者_JS百科 a url, have some random text in it, but at the same time load whatever page that needs to be loaded.

I'm thinking it's a mod_rewrite but I can't find any example to ignore the things past a valid page. I'm also thinking it's to do within the php code but I'm unsure on that too.

Thanks for any help.


Yes, mod_rewrite will let you do this, but you need to more clearly define how it should determine what part of the URI matters and what part it should throw out.

If that's determined by what files exist on a disk that may match part of the URI, you'll have to write PHP code to figure that out. That is, you'd create a rewrite rule to send all requests to the PHP script, which looks at $_SERVER['REQUEST_URI'] and compares to some list of files to determine what one to run or redirect to.

0

精彩评论

暂无评论...
验证码 换一张
取 消