0

I have a page in the following location: /property/happy_property_urls.php

My goal is to make the happy looking url's look like this: /en/london/apartment/for-rent/ww123/

I have tried various methods but none of them seem to stick and I only get 404 errors.

EXAMPLE NOT WORKING

<IfModule mod_rewrite.c> RewriteEngine on RewriteBase /property/ RewriteRule ^(.*?)$ happy_property_urls.php?lang=$1&city=$2&type=$3&status=$4&ref=$5 [NC,L,QSA] </IfModule> 

I am sadly failing badly.

Can someone give me some pointers please?

3
  • 1
    you've got one SINGLE capture group (.*?), and trying to use values from FIVE groups ($1 -> $5)? Commented Jun 16, 2015 at 18:34
  • Do your URL contain the word /property in it? Commented Jun 16, 2015 at 18:38
  • I am also trying RewriteRule /(.*)/(.*)/(.*)/(.*)/(.*)/$ /property/happy_property_urls.php?lang=$1&city=$2&type=$3&status=$4&ref=$5 Commented Jun 16, 2015 at 18:41

1 Answer 1

1

You can use this rule in the .htaccess in the root.

<IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$ property/happy_property_urls.php?lang=$1&city=$2&type=$3&status=$4&ref=$5 [NC,L,QSA] </IfModule> 
Sign up to request clarification or add additional context in comments.

1 Comment

@CraigEdmonds glad to hear it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.