Forums

Problems with htaccess redirects (9 posts)

  1. jordan_tvd
    Member
    Posted 4 months ago #

    Hello,

    I have a problem that I've been struggling with for some time. We are using a theme for WordPress that does not allow us to set a home page - it is done automatically in the theme.

    We are trying to use Google Web Optimizer to do split testing on some landing pages. Since we are not able to use the homepage of the theme, we are using three html files for the landing pages. The idea is the user will see this initial page, and either go to the thank you page ( the Coversion page) or go to the site itself.

    To do this, I wanted to make sure that the landing page is the first thing they see. Inside of my .htaccess file, I added "DirectoryIndex first.html". This had the desired effect of ensuring that a visitor to the site would see the landing page (and as an added bonus, worked with Google Web Optimizer). However, when I did this, I was not able to login to WordPress. It gave an error when I went to the wp-admin page.

    Next, I tried to edit the .htaccess to say "DirectoryIndex first.html index.php". This allowed me to have the landing page come first as I want, and also allowed us to log in to make edits. Unfortunately, whenever we tried to visit another page on the site (ie domain.com/otherpage), it would just take us back to the first.html page again.

    I'm stuck. Could someone please tell me what I'm doing wrong?

  2. Pankaj Pandey
    Member
    Posted 4 months ago #

    try this http://wordpress.org/extend/plugins/maxab/screenshots/,

    or you can modify theme to solve your problem.

  3. jordan_tvd
    Member
    Posted 4 months ago #

    Hi-

    Unfortunately, that doesn't solve my problem. The theme does not allow modification of the homepage.

    What I am trying to do is set up the htaccess file so that it will show an html page first. When I try and do a DirectoryIndex, I am then unable to login to WordPress.

    Google searches aren't yielding anything, but I can't be the first one to encounter this problem. Any ideas?

  4. Pankaj Pandey
    Member
    Posted 4 months ago #

    OK try this

    RewriteCond %{REQUEST_URI} ^/$
    Rewriterule ^(.*)$ http://mysite.com/landing.html [L,R=301]
  5. jordan_tvd
    Member
    Posted 4 months ago #

    Hi-

    I'm not sure where to put this.

    Here is the contents of my .htacces file:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /domain/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /domain/index.php [L]
    </IfModule>

    When I try and put the code you supplied in, there doesn't seem to be a change. Where should I put that code?

    Thank you for your time and help!

  6. Pankaj Pandey
    Member
    Posted 4 months ago #

    i am confident above work in case not work

    you can add another replace with following code
    RedirectMatch ^/$ http://example.com/landing.html/

    also i suggest to remove R=301 from previous code

  7. Pankaj Pandey
    Member
    Posted 4 months ago #

    Why rewrite base is domain there?

  8. Pankaj Pandey
    Member
    Posted 4 months ago #

    add my code after RewriteEngine On

  9. Pankaj Pandey
    Member
    Posted 4 months ago #

    let me explain what this code do its check if your someone access your website with http://www.site.com it will redirect to your landing.html

    if your user access http://www.site.com/anything that will work normally and go to anything.

    I hope this help. i am online another 20 min. reply fast for solution

    Thanks

Reply

You must log in to post.

About this Topic