Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
168 views
in Q2A Core by

Please help me. 

I have this in .htaccess file:

# In order for the web server to process this file it must be renamed to ".htaccess"

Options -Indexes

DirectoryIndex index.php

<IfModule mod_rewrite.c>

    RewriteEngine On

    #RewriteBase /

    RewriteCond %{REQUEST_URI} ^(.*)//(.*)$

    RewriteRule . %1/%2 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]

</IfModule> 

Redirect 301 /one /two

I'm getting this result in the URL: /?qa-rewrite=one

When i create dummy php files in the root: test.php and test2.php, redirection works from one file to the other one without problem.

How can I  solve this issue?

Q2A version: 1.8.5
by
RedirectMatch 301 ^/file1\.php$ /file2.php
by
RedirectPermanent /file1.php /file2.php
by
+1
Try to use Redirect rules before Rewrite rules.
Try to redirect specific urls before redirecting generic urls.
Try not to mix Redirect and Rewrite rules.
Try to use equivalent Rewrite rules instead of Redirect rules.
Google.
by
Thank you. I was searching for the answer on this website and I didn't find it. It was confusing to me. I thought it was something related to Q2A code. That's why I didn't use Google. I added this and it works:

RewriteRule ^one/?$  /two [L,NC,R=301]

Please log in or register to answer this question.

...