|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
New Poster, long time browser here.
I am currently running Apache Server 2.0.52 with PHP 4.3.9. What I was wondering was how would I go about making urls such as http://www.some-site.com/dir1/somepg.html look like http://www.some-site.com/dir1. (Minus the period obviously) If anyone could help it would be very much appreciated, and as always, thanks in advance for any help given. |
|
#2
|
||||
|
||||
|
use rewrting, mod_rewrite I think.
Moved to Web Server Configuration |
|
#3
|
||||
|
||||
|
Agreed, mod_rewrite
Check the documentation here: http://httpd.apache.org/docs/mod/mod_rewrite.html You may need to enable it on your server in the conf file... Here's a small guide, might be some help... |
|
#4
|
|||
|
|||
|
I have tried the mod_rewrite, and now have the following in
a .htaccess file in the commission directory. Options +FollowSymLinks RewriteEngine on RewriteRule Commissions/$ /Bcklshv3/commission/Commissions.php Now my problem is that each time I try to access the Commissions.php file I get a HTTP 500 (Internal server error). Any help on this? |
|
#5
|
||||
|
||||
|
Are you trying to access the file directly, or using http://yourdomain/Commissions/ ?
|
|
#6
|
|||
|
|||
|
What I am trying to do is access it through links from other webpages on my site. For example my server name is 3nimd.
So, when I try and access the file the address looks like http://3nimd/Bcklshv3/commission/Commissions.php. Whether I type this location directly into my address bar, or whether the page is accessed via a hyperlink, as long as I have a .htaccess file in the directory I receive an HTTP 500 (internal server error) message instead of the page. The very wierd part of the whole scenario happens when i remove the .htaccess file form the directory. Everything works fine, but then I am faced with the problem that the .htaccess file was trying to fix. Does it make a difference that I am running a Windows 2000 machine, and not a Linux/Unix OS which readily recognizes files that start with the .(dot) prefix like .htaccess. If this is the whole problem then I guess I will have to live with it since the workstation that I am on belongs to the company that I work for. Otherwise, I am completely stumped. Quote:
|
|
#7
|
||||
|
||||
|
Apache on Windows recognizes .htaccess files, don't worry...
So you get a 500 error when you access thefile using the proper path? What happens if you try accessing the file to your new mod_rewrite path? It may help to change all links to the page to link to the mod_rewrite path... [if using your mod_rewrite path gives a 500 error, your .htaccess may be incorrect] |
|
#8
|
|||
|
|||
|
All signs point to a problem with the .htaccess file, and most likely it's because of the rewrite rule.
Mod_rewrite is powerful, but it's also a little finicky... I would try finding a different pattern to use with RewriteRule. Also, for clarification, you're sending requests that end in "Commissions/" to "/Bcklshv3/commission/Commissions.php" |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Server Configuration > Only Displaying Directories while accessing pages |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|