php - What kind of htaccess rules would I need to accommodate files within folders? -
i'm rewriting portfolio website urls using following code in htaccess file,
rewriteengine on rewritebase / #remove enter code here.php; use the_request prevent infinite loops rewritecond %{the_request} ^get\ (.*)\.php\ http rewriterule (.*)\.php$ $1 [r=301] # remove index rewriterule (.*)/index$ $1/ [r=301] # remove slash if not directory rewritecond %{request_filename} !-d rewritecond %{request_uri} /$ rewriterule (.*)/ $1 [r=301] # add .php access file, don't redirect rewritecond %{request_filename}.php -f rewritecond %{request_uri} !/$ rewriterule (.*) $1\.php [l]
it works until want navigate page blog-post.php page example, let want go page url becomes cgarcia.design/web/about , should cgarcia.design/about page can load properly. now need change in htaccess file accommodate files within folders?
my nav structure following
- work
- about
- resume
- blog - posts folder - entry
- contact
thank suggestions.
add ned of document:
rewriterule ^$ web/ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ web/$1
Comments
Post a Comment