# Trying to mod\_rewrite for specific files

**URL:** https://forum.kirupa.com/t/trying-to-mod-rewrite-for-specific-files/296522
**Category:** Uncategorized
**Created:** [September 16, 2009, 2:47am UTC](https://forum.kirupa.com/t/trying-to-mod-rewrite-for-specific-files/296522 "2009-09-16T02:47:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![qhrome27](https://avatars.discourse-cdn.com/v4/letter/q/f04885/32.png) [@qhrome27](https://forum.kirupa.com/u/qhrome27)
#### Post date: [September 16, 2009, 2:47am UTC](https://forum.kirupa.com/t/trying-to-mod-rewrite-for-specific-files/296522/1 "2009-09-16T02:47:14Z")

</div>

Hello all,

Using a .htaccess file, I am trying to get a few specific files on my server to rewrite their URLs to contain “https://” at the beginning, for a secure connection.

I am using this code elsewhere

RewriteCond %{SERVER\_PORT} 80  
RewriteCond %{REQUEST\_URI} admin  
RewriteRule ^(.\*)$ https://www.\<Site URL goes here\>/admin/$1 [R,L]

To add the https for any file in that directory.

However, I have no idea how to apply this kind of action for specific files in a directory. And regular expressions have me very confused.

Any help is appreciated,  
Thanks
