Solved

.htacces issue

Posted on 2011-02-22
4
217 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
Comment Utility
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
Comment Utility
but their should be some differentiate betweek /plugins/ and /plugins
0
 
LVL 6

Expert Comment

by:MatthewP
Comment Utility
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
Comment Utility
\w+ could be used to match word characters only if you need it too (ie wont match the trailing /)
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now