Am a neonate to the entire world of apache and mvc devpt.
I'm having terrible nightmares (over 2 weeks now) writing an
.htaccess rule for an MVC application, such that all requests get
redirected to a public skin folder.
the way i want it, All publically viewable files are stored in the
/skin/ directory, and only these files should be accessible by my visitor's
browser. i.e, i need all requests to get directed to
/skin/index.php?url=REQUEST_URI in the background (not showing the entire server path).
here's my application structure-->
- mvc
------ App_lib
------ config
------ models
------ views
------ controllers
------ skin
--------- .htaccess
--------- css
--------- img
--------- js
--------- index.php
-.htaccess file
and here's the code in my mvc/.htaccess file -->
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ /skin/ [L]
RewriteRule (.*)/skin/$1 [L]
</IfModule>
and that in the mvc/skin/.htaccess file -->
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
# Rewrite all other URLs to index.php/URL
RewriteRule ^(.+)$ /index.php?url=$1 [QSA,L]
</IfModule>
can't now tell why my local browser's reporting:
Not Found
The requested URL /skin/ was not found on this server.
Apache/2.4.9
i've manually checked that the wamp/apache/apache module/rewrite module
is active, to no avail.
has anyone a guide for me ? or is there anything am failing
to include/remove from my .htaccess files ? please, any assistance
will be highly appreciated.............thanks in advance.
osgiedeprof 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.