1

I have created rewritten URLs for my site using .htaccess file.

Here is the content of the file.

RewriteEngine On
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ myfile.php?firstvar=$1&secondvar=$2&thirdvar=$3&fourthvar=$4

And when I checked, I found out that new clean URLs for the pages of my site has been created successfully. Like this :

www.mydomain.com/value1/value2/value3/value4

for the original URL :

www.mydomain.com/myfile.php?firstvar=value1&secondvar=value2&thirdvar=value3&fourthvar=value4

The new domain redirects to the original page properly and looks clearer. I like it.

But the problem is, that when I click the page on the main page, it still shows the original url. If I input the new clean URL in the address bar, it redirects to the page properly, but it is not a default URL. It is there, but it does not appear on the site naturally.

How do I set the new URL the dafault URL for my website? (still using .htaccess maybe?)

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Visualizer7
  • 325
  • 1
  • 5
  • 13
  • 2
    Resolved. I just modified some PHP files to render the result I wanted. My question now seems so stupid...but I will not delete it in case if there is someone who have the same problem in the future. I just changed the a href patterns which are automatically generated in my PHP files. Sorry for being silly :P – Visualizer7 Feb 19 '12 at 15:43

0 Answers0