I need to make the following changes to my server's httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
AllowOverride All
AccessFileName .htaccess
However, i was told that making direct change is not possible as it is a shell server so there is a need to use mod_rewrite via a .htaccess file.
My question is now, how do I convert the codes? I've tried searching everywhere but could not find any answer to this. Sorry that I am a newbie in this area.
Thank you very much.
Regards, Sean
I understand that your server is set to not allow you access to httpd.conf but rather gives you the ability to create .htaccess files to do your needed mod_rewrites. This is a typical scenario. You do not need to write anything to httpd.conf to make that happen. It is already done for you.
To create mod_rewrites you need to create an .htaccess file with any text editor with that name and no extension but with a preceding period (.) and save it to your domain root directly eg. www.yourdomain.com/.htaccess
Inside this file you would then write your mod_rewrite code following this pattern:
RewriteCond test_string cond_pattern
The following mod_rewrite code is oftentimes used with WordPress to allow pages and posts to have a more sensible permalink pattern:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
A good article to read on this topic can be found at: fubra.com
You cannot. Your settings basically instruct Apache to use .htaccess
as per-directory configuration file and grant such files all available permissions. Obviously:
The interesting point is why exactly you need those changes, given that .htaccess
is already the default value and the other directives are something the hosting services grant or deny according to their policies.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.