roybatty
roybatty

Reputation: 191

rewrite URL with mod-rewrite

I've to change my URL from

http://mysite.com/shtml/home.shtml

to

http://mysite.com/home.shtml

using mod-rewrite.

I tried something like this:

RewriteRule ^\/shtml\/(.*)$ /$1

Upvotes: 0

Views: 125

Answers (1)

anubhava
anubhava

Reputation: 785128

Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^shtml/(.+)$ /$1 [L,R,NC]

Upvotes: 2

Related Questions