Solved

.htacces issue

Posted on 2011-02-22
4
222 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

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.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

679 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