Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Hiding pages without extensions or filename

Posted on 2004-10-26
7
Medium Priority
?
211 Views
Last Modified: 2010-03-04
Hi,

I am using PHP 4.3.4, Apache 2.0.48 and Redhat 9.

There are many websites that does not seem to have a filename or extension such as .php, .jsp etc. Eg: http://www.domain.com/webpage?string=xx
or some sites even have the filename and extension missing!
Eg: http://www.domain.com/webpage/?string=xx

I would like to know how can i do this on apache and what are the changes i need to make on my scripts.

Thanks
0
Comment
Question by:pajiao
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 12417846
use Alias, see http:Q_20776384.html to learn more details
0
 

Author Comment

by:pajiao
ID: 12419432
Thanks yuzh,

The solution will need to specify alias for every page involved and it will be a hassle for huge sites. How can i do it without specifying it manually and getting it to direct by itself?

thanks
0
 

Author Comment

by:pajiao
ID: 12419492
I found a link which does similiar to what i want using mod_rewrite but i need to specify for every page that exists. Is there an dynamic method?

Here is the link:
http://www.phpfreaks.com/tutorials/23/0.php
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 5

Accepted Solution

by:
mrielf earned 100 total points
ID: 12421305
You can use RewriteCond to check that request with various extensions is real file or not.
0
 

Author Comment

by:pajiao
ID: 12430294
Any examples mrielf?
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 600 total points
ID: 12430814
0
 
LVL 4

Assisted Solution

by:TomDavidson
TomDavidson earned 300 total points
ID: 12550544
ForceType is a way of forceing apache to treat certain files like other file types. In this example:
http://www.mywebpage.com/myfile would be treated as php

<Files myfile>
  ForceType application/x-httpd-php
</Files>

you can also use wildcards I believe so maybe something like:

<Files p*>
  ForceType application/x-httpd-php
</Files>

would work for you, it would evaluate all file starting with p as php scripts. If you want a more complicated naming convention for your scripts FilesMatch works much the same as files but allow a regular expression match instead.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question