another .htaccess question

Can I redirect pages wqith .htaccess

I need when the page "mypage.html" is called for to direct it to "thepage.php"

I also need it to the same thing for these 2 pages

"onepage.html" needs to direct to "pages.php"

If so how can I write this.

Thanks
LVL 1
smphilAsked:
Who is Participating?
 
int_20hCommented:
0
 
smphilAuthor Commented:
I still can't get it the rewrite working?
0
 
int_20hCommented:
Ok, try the following in you httpd.conf:


<IfModule alias_module>
    #
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server's namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /mypage.html http://www.yourdomain.com/thepage.php
    Redirect permanent /onepage.html http://www.yourdomain.com/pages.php
</IfModule>

Remember to change yourdomain for your real domain... also make sure the directory matches
0
 
hkey_current_userCommented:
why not just put this in the head of the HTML document:

<meta http-equiv="refresh" content="0;URL=thepage.php" />
0
 
Muhammad WasifCommented:

RewriteEngine On
RewriteRule ^mypage\.html$ thepage.php [L]
RewriteRule ^onepage\.html$ pages.php [L]

But for this you need to enable mod_rewrite
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.