Reputation: 1015
I have searched the internet and followed the steps but I can't get this to work properly.
Step1: Activated 'rewrite_module' in the apache menu. After running phpinfo(), it shows that the module is infact loaded.
Step 2: I made changes to httpd.conf:
<Directory "c:/program Files/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
Here is my .htaccess:
RewriteEngine On
RewriteRule ^tempor\.com/([^/]*)\.htm$ /tempor.com/index.php?page=$1 [L]
Goal: Rewrite url from localhost/tempor.com/index.php?page=about to localhost/tempor.com/about.htm
Test result: Nothing happens. The url isn't changed. If I put some trash texts into the .htaccess, i get an error so I know that .htaccess is being loaded.
Upvotes: 1
Views: 67
Reputation: 785146
Change your DOCUMENT_ROOT/tempor.com/.htaccess
code to:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /tempor.com/
# external redirection from /tempor.com/index.php?page=about to /tempor.com/about.htm
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+tempor\.com/index\.php\?page=([^&\s]+) [NC]
RewriteRule ^ %1.htm? [R=301,L]
# internal forward from /tempor.com/about.htm to /tempor.com/index.php?page=about
RewriteRule ^(.+?)\.html?$ index.php?page=$1 [L,QSA,NC]
Upvotes: 1