Solved

.htacces issue

Posted on 2011-02-22
4
220 Views
Last Modified: 2012-08-13
I'm new to .htaccess  and needs assistance. using following code and plugins.php can be accessed like http://sitename/plugins but I have a directory named plugins and want to access it like http://sitename/plugins/ 

Options +FollowSymLinks
Options +Indexes
RewriteEngine on
#RewriteCond %{SCRIPT_FILENAME} !-f
#RewriteRule ^([^\.]+)$ $1.php [NC,L]
0
Comment
Question by:hiddenpearls
  • 2
4 Comments
 

Expert Comment

by:jtuinstra
ID: 34950013
I am not sure, but I don't think that is possible. As you are refering to the same place. http://sitename/plugins/ is the same as http://sitename/plugins You need to direct to a different name.
0
 

Author Comment

by:hiddenpearls
ID: 34950160
but their should be some differentiate betweek /plugins/ and /plugins
0
 
LVL 6

Expert Comment

by:MatthewP
ID: 34951121
The .+ in your regexp matches 1 or more of anything including a trailing forward slash. Can't you do

RewriteRule ^plugins$

that should do a redirect if the trailing slash isn't present only
0
 
LVL 6

Accepted Solution

by:
MatthewP earned 500 total points
ID: 34951136
\w+ could be used to match word characters only if you need it too (ie wont match the trailing /)
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

809 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